I\'m starting with socket.io + node.js, I know how to send a message locally and to broadcast socket.broadcast.emit()
function:- all the connected clients recei
You can refer to socket.io rooms. When you handshaked socket - you can join him to named room, for instance "user.#{userid}".
After that, you can send private message to any client by convenient name, for instance:
io.sockets.in('user.125').emit('new_message', {text: "Hello world"})
In operation above we send "new_message" to user "125".
thanks.