Skip to content

Instantly share code, notes, and snippets.

@furkancelik
Created August 25, 2016 00:58
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 furkancelik/72fe905c1602e2f72757f0818089ce41 to your computer and use it in GitHub Desktop.
Save furkancelik/72fe905c1602e2f72757f0818089ce41 to your computer and use it in GitHub Desktop.
var WebSocketServer = require('ws').Server
, wss = new WebSocketServer({ port: 8083 });
wss.on('connection', function connection(ws) {
ws.on('message', function incoming(message) {
console.log('received: %s', message);
// ws.send("message");
ws.send(message);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment