Last active
August 29, 2015 13:56
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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