Created
          May 20, 2011 07:54 
        
      - 
      
- 
        Save dvv/982523 to your computer and use it in GitHub Desktop. 
    socket.io-169
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | --- websocket.js.orig 2011-05-20 11:50:10.000000000 +0400 | |
| +++ websocket.js 2011-05-20 11:59:19.000000000 +0400 | |
| @@ -11,6 +11,10 @@ | |
| util.inherits(WebSocket, Client); | |
| +WebSocket.prototype._isSecure = function(){ | |
| + return this.request.socket.encrypted; | |
| +}; | |
| + | |
| WebSocket.prototype._onConnect = function(req, socket){ | |
| var self = this | |
| , headers = []; | |
| @@ -33,7 +37,7 @@ | |
| } | |
| var origin = this.request.headers.origin, | |
| - location = (this.request.socket.encrypted ? 'wss' : 'ws') | |
| + location = (this._isSecure() ? 'wss' : 'ws') | |
| + '://' + this.request.headers.host + this.request.url; | |
| this.waitingForNonce = false; | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment