diff --git a/lib/node-http-proxy/http-proxy.js b/lib/node-http-proxy/http-proxy.js index 83a2bf1..bb4f453 100644 --- a/lib/node-http-proxy/http-proxy.js +++ b/lib/node-http-proxy/http-proxy.js @@ -322,6 +322,13 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) { // reverseProxy.once('error', proxyError); + // + // If `req` is aborted, we abort our `reverseProxy` request as well. + // + req.on('aborted', function () { + reverseProxy.abort(); + }); + // // For each data `chunk` received from the incoming // `req` write it to the `reverseProxy` request.