Created
February 17, 2015 07:34
-
-
Save guiltry/5066d45e95ae917ed7d9 to your computer and use it in GitHub Desktop.
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
// From client side, they just need to subscribe to what they need. | |
window.realtime.socketIo.emit('subscribe_public', { | |
channel: ch | |
}); | |
// or the private one, | |
window.realtime.socketIo.emit('subscribe_private', { | |
channel: ch, | |
jwt: localStorage.jwt | |
}); | |
// and listen. | |
window.realtime.socketIo.on('chat', function (m) { | |
console.log(m.html); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment