So I wanted to do something a bit more active with Networking. Ever since the "reddit place", I've been interested in doing my own version of it...
Timelapse of the Reddit Place...
So here's my version of it with
React handling the client side display and
socket.io handling the server and the interaction between the client and the user. It works by
socket.io creating a connection to the server, the server responds with how many users are currently connected, and broadcasts the same number to all the other connected clients.
Then when it receives pixel data from any of the clients, it'll broadcasts the same data to the other clients so everybody can see what that one client did.
The clients can interact by clicking the canvas on the webpage and it places a square of that colour. The other clients receive this data and their clients will also update. The next step in the Networking adventures I am partaking in will include a MUD based game (a small one though).
Link to the code is here on GitHub, a demo is also in works as soon as I get around to building the production version for React.