Change logging of URL to be compatible with both old and new versions

of ws
This commit is contained in:
Sam Frances 2017-05-18 10:08:54 +01:00
parent 3e17187216
commit 141ba0088e
1 changed files with 1 additions and 1 deletions

View File

@ -28,7 +28,7 @@ var argv = require('optimist').argv,
// Handle new WebSocket client
new_client = function(client, req) {
var clientAddr = client._socket.remoteAddress, log;
console.log(req.url);
console.log(req ? req.url : client.upgradeReq.url);
log = function (msg) {
console.log(' ' + clientAddr + ': '+ msg);
};