Skip to content

fix(socks5): destroy sockets after negotiation timeout - #5705

Open
drewmt wants to merge 1 commit into
nodejs:mainfrom
drewmt:fix/socks5-timeout-socket-leak
Open

fix(socks5): destroy sockets after negotiation timeout#5705
drewmt wants to merge 1 commit into
nodejs:mainfrom
drewmt:fix/socks5-timeout-socket-leak

Conversation

@drewmt

@drewmt drewmt commented Aug 20, 2026

Copy link
Copy Markdown

This relates to...

Closes #5704.

Rationale

When SOCKS5 authentication or CONNECT negotiation timed out, the connection promise rejected before the socket reached a pool. The open socket was therefore left untracked and could survive for the lifetime of the process.

Changes

Features

N/A

Bug Fixes

  • Destroy the SOCKS5 client before rejecting either negotiation timeout.
  • Add focused regression coverage for stalled authentication and CONNECT responses.

Validation:

  • node --test test/issue-5704.js
  • node --test test/socks5-proxy-agent.js test/issue-5704.js
  • npm run lint

Breaking Changes and Deprecations

N/A

Status

Signed-off-by: drewmt <idrew.mt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Socks5ProxyAgent: SOCKS5 handshake/auth timeout leaks the underlying socket

1 participant