I am new to NodeJS and Socket IO, I use PHP and jQuery. I want to be able to have a number of different elements of my social network be connected with socket io and send data and such, however I’ve run into the problem of sending certain data to certain users only, and then on top of that, certain kinds of data based on which page is loaded. What sounds like would be a nice way of having this work is attaching different socket IO events or what not to certain divs, so when those divs are loaded, those sockets are being done, and none other. Then I also need a way of keeping track of what users to send the data to.
Share
You should try to use socket.io Rooms. This is an example:
You can have a lot of different kind of users and send/receive data depending on the room they joined.
You can use redis to store that kind of information, thats a nice way to do it.