How can in send data to a specific connected socket in Node.js? I want to write a server that accepts incoming sockets, assigns them an id, and then when messages are sent from the other client, it is directed to that one. I guess you could say similar to a private message.
Also, is there a way to emit data EXCLUDING one socket?
There are similar questions on stackoverflow, here’s an example:
Sending a message to a client via its socket.id
Quick version: