Skip to content

Instantly share code, notes, and snippets.

@avidanyum
Created January 24, 2016 14:21
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 avidanyum/aa46d3612c3c71182269 to your computer and use it in GitHub Desktop.
Save avidanyum/aa46d3612c3c71182269 to your computer and use it in GitHub Desktop.
after using wss and ws still having the stuck "connecting" issue
var wsServer = require('ws').Server;
var wss = new wsServer({
port: '8080',
path: 'mypath'
});
wss.on('connection', function connection(ws) {
ws.on('open', function open() {
ws.send('something');
});
ws.on('message', function(data, flags) {
console.log("got message: " + data)
// flags.binary will be set if a binary data is received.
// flags.masked will be set if the data was masked.
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment