I have never used websockets, webworkers and everything related to it before. Obviously, I'm lost and I don't know how to do this correctly.
I've learned how to make a websocket and have it work successfully in the server port. Also, load a web worker (but this doesn't refresh the site directly).
When the user connects, everything works fine. The Websocket is sending messages to the user, and the user is refreshing their website.
The problem is when I want to use it with many other users (different tabs or browsers to simulate different users). Only works for the next user connecting via websocket, no longer for other users.
I share a diagram just to make it easier for everyone to understand what I want to do.
One more thing is. What language do I have to use for both the server and the user to get this information? Python, NodeJs, Php (these are the only ones I know how to use).
solved!
Just generate a number assigned to each client (which can be different devices from each other) and then send the random number generated by the server to each connection!
Before "Connection" you should add:
After "Connection" you should add: