Skip to content

Instantly share code, notes, and snippets.

@rogerdudler
Created August 19, 2011 08:46
Show Gist options
  • Save rogerdudler/1156357 to your computer and use it in GitHub Desktop.
Save rogerdudler/1156357 to your computer and use it in GitHub Desktop.
Socket.io notification types
// Send the message to all clients except the sender
socket.broadcast.emit('event', data);
// Same but not guaranteed
socket.volatile.emit('event', data);
// Send the message to all clients including the sender
io.sockets.emit('event', data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment