Skip to content

Instantly share code, notes, and snippets.

View fadsel's full-sized avatar

Fahad Kassim fadsel

View GitHub Profile
@fadsel
fadsel / socket-cheatsheet.js
Last active July 5, 2017 10:26 — forked from alexpchin/socket-cheatsheet.js
A quick cheatsheet for socket.io
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender