diff --git a/lib/http-proxy/passes/web-incoming.js b/lib/http-proxy/passes/web-incoming.js index 7ae735514..a5bacbe4b 100644 --- a/lib/http-proxy/passes/web-incoming.js +++ b/lib/http-proxy/passes/web-incoming.js @@ -143,8 +143,8 @@ module.exports = { } // Ensure we abort proxy if request is aborted - req.on('aborted', function () { - proxyReq.abort(); + res.on('close', function () { + proxyReq.destroy(); }); // handle errors in proxy and incoming request, just like for forward proxy