Created
August 19, 2011 08:44
-
-
Save rogerdudler/1156353 to your computer and use it in GitHub Desktop.
Socket.io usage on client-side
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
// create socket connection | |
var socket = io.connect('http://localhost:8000'); | |
// listen to an event | |
socket.on('event', function(data) {}); | |
// send an event | |
socket.emit('event', data, function() {}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment