Skip to content

Commit

Permalink
Merge pull request socketio#868 from bodash/patch-1
Browse files Browse the repository at this point in the history
I continued to have websocket connection issues in Safari when using SSL...
  • Loading branch information
rauchg committed May 2, 2012
2 parents de1afe1 + ffa8994 commit 39671e8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/transports/websocket/default.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*!
* socket.io-node
* Copyright(c) 2011 LearnBoost <[email protected]>
Expand Down Expand Up @@ -89,11 +88,14 @@ WebSocket.prototype.onSocketConnect = function () {
}

var origin = this.req.headers['origin']
, location = ((this.manager.settings['match origin protocol'] ?
origin.match(/^https/) : this.socket.encrypted) ?
'wss' : 'ws')
+ '://' + this.req.headers.host + this.req.url
, waitingForNonce = false;
, waitingForNonce = false;
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){
location = 'wss://' + this.req.headers.host + this.req.url;
}else{
location = 'ws://' + this.req.headers.host + this.req.url;
}

if (this.req.headers['sec-websocket-key1']) {
// If we don't have the nonce yet, wait for it (HAProxy compatibility).
Expand Down

0 comments on commit 39671e8

Please sign in to comment.