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,