diff --git a/lib/transports/websocket/default.js b/lib/transports/websocket/default.js index 091fdd44fd..4e23835def 100644 --- a/lib/transports/websocket/default.js +++ b/lib/transports/websocket/default.js @@ -74,7 +74,8 @@ WebSocket.prototype.protocolVersion = 'hixie-76'; */ WebSocket.prototype.onSocketConnect = function () { - var self = this; + var self = this + , location; this.socket.setNoDelay(true); @@ -89,11 +90,11 @@ WebSocket.prototype.onSocketConnect = function () { var origin = this.req.headers['origin'] , waitingForNonce = false; - if(this.manager.settings['match origin protocol']){ + if (this.manager.settings['match origin protocol']) { location = (origin.indexOf('https')>-1 ? 'wss' : 'ws') + '://' + this.req.headers.host + this.req.url; - }else if(this.socket.encrypted){ + } else if (this.socket.encrypted){ location = 'wss://' + this.req.headers.host + this.req.url; - }else{ + } else { location = 'ws://' + this.req.headers.host + this.req.url; }