Skip to content

Instantly share code, notes, and snippets.

@AlexanderBrevigSublime
Created October 1, 2012 09:50
Show Gist options
  • Save AlexanderBrevigSublime/3810615 to your computer and use it in GitHub Desktop.
Save AlexanderBrevigSublime/3810615 to your computer and use it in GitHub Desktop.
HTML: Socket.io client
<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