From aa1981b974819875c28e6635ef551610bd07892e Mon Sep 17 00:00:00 2001 From: arno renevier Date: Sat, 16 Nov 2024 06:49:41 -0800 Subject: [PATCH] fix: close targetSocket when proxy replies with non-200 status (#561) Fixes issue #560 --- src/chain.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/chain.ts b/src/chain.ts index f5370355..14ce2b3c 100644 --- a/src/chain.ts +++ b/src/chain.ts @@ -117,6 +117,8 @@ export const chain = ( sourceSocket.end(createCustomStatusHttpResponse(status, `UPSTREAM${statusCode}`)); } + targetSocket.end(); + server.emit('tunnelConnectFailed', { proxyChainId, response,