Skip to content

Instantly share code, notes, and snippets.

@tchajed
Created May 17, 2012 03:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tchajed/2715894 to your computer and use it in GitHub Desktop.
Save tchajed/2715894 to your computer and use it in GitHub Desktop.
handling sessions in socket.io
// from https://github.com/LearnBoost/Socket.IO/wiki/Migrating-0.6-to-0.7+
// saving the socket id
var sid = socket.id
// sending a message to a particular socket
io.socket(sid).emit("my event", [args])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment