I have a set of Socket.IO sockets. For some of them I will never want to emit, yet I want to be able to use things like .broadcast() or io.sockets.emit(). I also still want to receive information from these sockets.
Is there a way to disable output to certain sockets, or do I need to store a list of active sockets and manually iterate through them to simulate a broadcast.
When socket connects you should join him to the specific room, socket.join('roomname'), and then you be able to send io.sockets.to('roomname').emit(), if for some reason you do not want specific socket getting data from that room you always can remove that socket from specific room by socket.leave('roomname')