diff --git a/packages/proxy/lib/http/request-middleware.ts b/packages/proxy/lib/http/request-middleware.ts index 63726ddc8d9f..b857ad4fc3ca 100644 --- a/packages/proxy/lib/http/request-middleware.ts +++ b/packages/proxy/lib/http/request-middleware.ts @@ -170,7 +170,7 @@ const SendRequestOutgoing: RequestMiddleware = function () { req.on('error', this.onError) req.on('response', (incomingRes) => this.onResponse(incomingRes, req)) - this.req.on('aborted', () => { + this.req.socket.on('close', () => { this.debug('request aborted') req.abort() })