Skip to content

fix(socks5): use configured connector in Socks5ProxyAgent#5168

Merged
mcollina merged 3 commits into
nodejs:mainfrom
trivikr:socks5-proxy-agent-options-connect
May 5, 2026
Merged

fix(socks5): use configured connector in Socks5ProxyAgent#5168
mcollina merged 3 commits into
nodejs:mainfrom
trivikr:socks5-proxy-agent-options-connect

Conversation

@trivikr
Copy link
Copy Markdown
Member

@trivikr trivikr commented May 2, 2026

This relates to...

Fixes: #5167

Rationale

Socks5ProxyAgent initializes a connector from options.connect or buildConnector({ ...options.proxyTls }), but createSocks5Connection() connected to the SOCKS5 proxy with net.connect() directly.
This bypassed custom proxy connectors and could prevent proxyTls options from being honored.

Changes

  • Use the configured connector when opening the connection to the SOCKS5 proxy.
  • Preserve SOCKS5 proxy TLS behavior by selecting the connector protocol based on proxyTls.

Features

N/A

Bug Fixes

Use configured connector in Socks5ProxyAgent

Breaking Changes and Deprecations

N/A

Status

Assisted-by: openai:gpt-5.5

Assisted-by: openai:gpt-5.5
Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.26%. Comparing base (a07d945) to head (4904cbc).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5168      +/-   ##
==========================================
- Coverage   93.28%   93.26%   -0.02%     
==========================================
  Files         110      110              
  Lines       36313    36309       -4     
==========================================
- Hits        33873    33865       -8     
- Misses       2440     2444       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@trivikr trivikr changed the title fix: use configured connector in Socks5ProxyAgent fix(socks5): use configured connector in Socks5ProxyAgent May 2, 2026
Comment thread test/socks5-proxy-agent.js Outdated
Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina merged commit 1a45226 into nodejs:main May 5, 2026
59 of 61 checks passed
@trivikr trivikr deleted the socks5-proxy-agent-options-connect branch May 6, 2026 21:46
@github-actions github-actions Bot mentioned this pull request May 14, 2026
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 ignores options.connect

3 participants