Permalink
Browse files

Better URL parsing logic for ws:// URLs.

  • Loading branch information...
1 parent 9d14baa commit 21bb2b1a40f45569c9430780988c2afd9a81c1e9 @pgriess committed Aug 5, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/websocket.js
View
@@ -419,7 +419,7 @@ var WebSocket = function(url, proto) {
case 'ws':
var u = urllib.parse(url);
httpClient = http.createClient(u.port || 80, u.hostname);
- httpPath = '/' + url.replace(/([^\/]*\/){3}/, '');
+ httpPath = (u.pathname || '/') + (u.search || '');
httpHeaders.Host = u.hostname;
break;

0 comments on commit 21bb2b1

Please sign in to comment.