Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/emit.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ function onConnect(socket){
// sending to all clients in namespace 'myNamespace', including sender
io.of('myNamespace').emit('bigger-announcement', 'the tournament will start soon');

// sending to a specific room in a specific namespace, including sender
io.of('myNamespace').to('room').emit('event', 'message');

// sending to individual socketid (private message)
socket.to(<socketid>).emit('hey', 'I just met you');

Expand Down