Skip to content

Commit

Permalink
Support ws3
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Atkinson committed May 22, 2017
1 parent 67b6430 commit e9bf335
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions websocket-relay.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ var STREAM_SECRET = process.argv[2],
// Websocket Server
var socketServer = new WebSocket.Server({port: WEBSOCKET_PORT, perMessageDeflate: false});
socketServer.connectionCount = 0;
socketServer.on('connection', function(socket) {
socketServer.on('connection', function(socket, upgradeReq) {
socketServer.connectionCount++;
console.log(
'New WebSocket Connection: ',
socket.upgradeReq.socket.remoteAddress,
socket.upgradeReq.headers['user-agent'],
(upgradeReq || socket.upgradeReq).socket.remoteAddress,
(upgradeReq || socket.upgradeReq).headers['user-agent'],
'('+socketServer.connectionCount+' total)'
);
socket.on('close', function(code, message){
Expand Down

0 comments on commit e9bf335

Please sign in to comment.