Skip to content

Instantly share code, notes, and snippets.

@cshepp
Created August 3, 2012 15:10
Show Gist options
  • Save cshepp/3248484 to your computer and use it in GitHub Desktop.
Save cshepp/3248484 to your computer and use it in GitHub Desktop.
Socket.io disconnect
socket.on('disconnect', function(socket){
socket.get('room', function(err, room){
socket.get('nick', function(err, nick){
socket.broadcast.to(room).emit('client-left', nick);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment