Created
October 1, 2012 09:50
-
-
Save AlexanderBrevigSublime/3810615 to your computer and use it in GitHub Desktop.
HTML: Socket.io client
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
<script src="/socket.io/socket.io.js"></script> | |
<script> | |
var socket = io.connect('http://localhost'); | |
socket.on('channel1', function (data) { | |
console.log(data); | |
socket.emit('channel2', { other: 'message' }); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment