What the Server should do:
- When the Client (right side) sends a message to the Relay-Server, the Server should relay the message to the Host (left side). After the Host processes the message, he should send a replay to this Client. The Client shouldn't send messages directly to other Clients.
- The Relay-Server should have the ability to broadcast messages to all Clients
What i already have done:
- I already installed Node.js and downloaded the Websocket Library
- I read the GitHub page of the Websocket Library
- I watched some tutorials, but i didn't get it yet.
What i need help with:
Im learning reale fast and never had problems to find the right tutorials to improve myself, but im stuck und i need help with how to code these things.
I would reale appreciate, if somebody could teach me.
So ... I now know, that I have to set an array on the Relay-Server and assign every user ,who connects, an unique ID to identify them ... the problem is, I don't know how. Would be nice, if the unique ID would be a 4 char ID like the one on the signaling server by scirra.
So something like:
Client sends encrypted Message to Server -> Server adds Unique ID and sends Message to Host
Host sends encrypted Message with Unique ID to Server -> Server removes Unique ID and sends Message to that Client