Skip to content

Instantly share code, notes, and snippets.

@bradurani
Created July 27, 2017 04:03
Show Gist options
  • Save bradurani/15b59b56ae3d1d1e509d363b0a9553c8 to your computer and use it in GitHub Desktop.
Save bradurani/15b59b56ae3d1d1e509d363b0a9553c8 to your computer and use it in GitHub Desktop.
const WebSocket = require('ws');
const server = new WebSocket.Server({ port: 8080 });
server.on('connection', function connection(ws) {
ws.send('connected')
ws.on('message', function incoming(message) {
ws.send('something');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment