So I have a chat room, and I want to emit a message to everyone except me (b/c I'm going to update the chat window via JS on form submit with my message), I tried like this:
io.sockets.in(socket.room)
.broadcast
.emit('new message', {
'username' : socket.nickname,
'message' : data,
'color' : socket.color
});
It doesn't work. Do you guys know how can I do this?