Permalink
Browse files

include port in HTTP request host header if port is not default (80)

  • Loading branch information...
1 parent bf4f9d7 commit 501fa01d04ccbb80b73e42ecfe13bb48d0d9af4a @izuzak izuzak committed Nov 20, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/websocket.js
View
@@ -441,7 +441,7 @@ var WebSocket = function(url, proto, opts) {
var u = urllib.parse(url);
httpClient = http.createClient(u.port || 80, u.hostname);
httpPath = (u.pathname || '/') + (u.search || '');
- httpHeaders.Host = u.hostname;
+ httpHeaders.Host = u.hostname + (u.port ? (":" + u.port) : "");
break;
case 'ws+unix':

0 comments on commit 501fa01

Please sign in to comment.