Skip to content

Commit

Permalink
Merge pull request phoboslab#167 from Nibbler999/ws-3
Browse files Browse the repository at this point in the history
Support ws3
  • Loading branch information
phoboslab authored May 22, 2017
2 parents 67b6430 + e9bf335 commit 000bd2f
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 000bd2f

Please sign in to comment.