Skip to content

Commit

Permalink
fix: close targetSocket when proxy replies with non-200 status (#561)
Browse files Browse the repository at this point in the history
Fixes issue #560
  • Loading branch information
arenevier authored Nov 16, 2024
1 parent 67f961d commit aa1981b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ export const chain = (
sourceSocket.end(createCustomStatusHttpResponse(status, `UPSTREAM${statusCode}`));
}

targetSocket.end();

server.emit('tunnelConnectFailed', {
proxyChainId,
response,
Expand Down

0 comments on commit aa1981b

Please sign in to comment.