Skip to content

Instantly share code, notes, and snippets.

@rogerdudler
Created August 19, 2011 08:44
Show Gist options
  • Save rogerdudler/1156353 to your computer and use it in GitHub Desktop.
Save rogerdudler/1156353 to your computer and use it in GitHub Desktop.
Socket.io usage on client-side
// 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