Skip to content

Instantly share code, notes, and snippets.

@einaros
Created December 9, 2011 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save einaros/1452218 to your computer and use it in GitHub Desktop.
Save einaros/1452218 to your computer and use it in GitHub Desktop.
ws server example
var WebSocketServer = require('ws').Server
, wss = new WebSocketServer({port: 8080});
wss.on('connection', function(ws) {
ws.on('message', function(message) {
console.log('received: %s', message);
});
ws.send('something');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment