DEV Community

Jouini Hamza
Jouini Hamza

Posted on

tacking users sockets in a social network with nodejs and socket.io

So i am creating a social network for my university , this made me think how to track users with multiple socket like facebook does when you send a message it will pop up on all devices and browser tabs , this is easy if you keep track of user's sockets in array but isn't that how rooms work , so instead of doing that you just create a room for every user but i am wondering if is that the best practice ?

Top comments (1)

Collapse
 
leifermendez profile image
Leifer Mendez

Hi. Well I have a medium post link.medium.com/2x8UusXDhbb about socket.io up and rooms. I think you should clone repo and try.