Skip to content

Commit 45ef87e

Browse files
indutnyindexzero
authored andcommitted
[websockets] add latest websockets support
1 parent 6c6fec0 commit 45ef87e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: lib/node-http-proxy/http-proxy.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
393393
//
394394
// Setup the incoming client socket.
395395
//
396-
_socket(socket);
396+
_socket(socket, true);
397397

398398
//
399399
// On `upgrade` from the Agent socket, listen to
@@ -663,7 +663,12 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
663663
// request. This is small, and there's only ever one of
664664
// it; no need for pause/resume.
665665
//
666+
// XXX This is very wrong and should be fixed in node's core
667+
//
666668
reverseProxy.write(head);
669+
if (head && head.length === 0) {
670+
reverseProxy._send('');
671+
}
667672
}
668673
catch (ex) {
669674
return proxyError(ex);

0 commit comments

Comments
 (0)