diff --git a/lib/node-http-proxy/http-proxy.js b/lib/node-http-proxy/http-proxy.js index 82bc533..35ddb3d 100644 --- a/lib/node-http-proxy/http-proxy.js +++ b/lib/node-http-proxy/http-proxy.js @@ -326,6 +326,13 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) { } }); + //Aborts reverseProxy if client aborts the connection. + req.on('close', function () { + if (!errState) { + reverseProxy.abort(); + } + }); + // // If we have been passed buffered data, resume it. //