diff --git a/lib/node-http-proxy/http-proxy.js b/lib/node-http-proxy/http-proxy.js index 227948d1e..7ae8b6c3e 100644 --- a/lib/node-http-proxy/http-proxy.js +++ b/lib/node-http-proxy/http-proxy.js @@ -590,11 +590,12 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer) // outgoing.host = this.target.host; outgoing.port = this.target.port; + outgoing.agent = agent; outgoing.method = 'GET'; outgoing.path = req.url; outgoing.headers = req.headers; - var reverseProxy = agent.appendMessage(outgoing); + var reverseProxy = this.target.protocol.request(outgoing); // // On any errors from the `reverseProxy` emit the