Skip to content

Instantly share code, notes, and snippets.

@atorralb
Last active August 29, 2015 13:56
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 atorralb/8986799 to your computer and use it in GitHub Desktop.
Save atorralb/8986799 to your computer and use it in GitHub Desktop.
emit a message to a different namespace in socket.io... useful when you want to update different namespaces with different data
var chat = io
.of('/chat')
.on('connection', function (socket) {
//warn the admin that somebody visit the site
io.of('/admins').emit('message', { message: "Hello admins! im a different namespace phocker" });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment