Skip to content

Instantly share code, notes, and snippets.

@einaros
Created December 4, 2011 22:45
Show Gist options
  • Save einaros/1431539 to your computer and use it in GitHub Desktop.
Save einaros/1431539 to your computer and use it in GitHub Desktop.
var WebSocket = require('ws')
, ws = new WebSocket('ws://www.host.com/path');
ws.on('open', function() {
ws.send('something');
});
ws.on('message', function(message) {
console.log('received: %s', message);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment