diff --git a/lib/node-http-proxy/http-proxy.js b/lib/node-http-proxy/http-proxy.js index faf133f31..204641b09 100644 --- a/lib/node-http-proxy/http-proxy.js +++ b/lib/node-http-proxy/http-proxy.js @@ -393,7 +393,7 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer) // // Setup the incoming client socket. // - _socket(socket); + _socket(socket, true); // // On `upgrade` from the Agent socket, listen to @@ -663,7 +663,12 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer) // request. This is small, and there's only ever one of // it; no need for pause/resume. // + // XXX This is very wrong and should be fixed in node's core + // reverseProxy.write(head); + if (head && head.length === 0) { + reverseProxy._send(''); + } } catch (ex) { return proxyError(ex);