Skip to content

Instantly share code, notes, and snippets.

@dsimmons
Created October 19, 2012 15:17
Show Gist options
  • Save dsimmons/3918774 to your computer and use it in GitHub Desktop.
Save dsimmons/3918774 to your computer and use it in GitHub Desktop.
Socket.io Client Example
socket = io.connect('http://localhost:3000');
socket.on('connect', function() {
console.log("Connected to the server!");
socket.emit('command', 'someVar = 5');
socket.on('result', function(result) {
console.log("Received result:", result);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment