Skip to content

Add support for socks5h (use domain name rather than resolved IP)#8341

Open
eikelang-vm wants to merge 2 commits into
usebruno:mainfrom
eikelang-vm:feature/socks5h-remote-dns
Open

Add support for socks5h (use domain name rather than resolved IP)#8341
eikelang-vm wants to merge 2 commits into
usebruno:mainfrom
eikelang-vm:feature/socks5h-remote-dns

Conversation

@eikelang-vm

@eikelang-vm eikelang-vm commented Jun 23, 2026

Copy link
Copy Markdown

Description

Adds SOCKS5h as a proxy protocol option (Preferences ▸ Proxy and Collection ▸ Proxy) so DNS resolution happens on the proxy side instead of locally — needed when the target only resolves from the proxy's network.

socks5 resolves the hostname locally and sends the IP; socks5h forwards the hostname to the proxy. The agent layer already routes any socks* protocol through socks-proxy-agent (which parses socks5h as remote-DNS), so only the protocol enums + UI radios needed adding, plus a regression test.

I made this change primarily to address a personal need, but the resulting diff was small and focused enough that I considered offering it as a PR, especially considering that I was able to find at least two issues directly requesting this feature/pointing out the fact that SOCKS proxy requests currently fail if the name can only be resolved on the side of the proxy.

Depending on your point of view, the SOCKS5h support might be considered incomplete, because

  • SOCKS5h remains unsupported when using a proxy PAC file. I have no use for this and at first glance there's no standardized way to distinguish SOCKS5 and SOCKS5h in proxy PAC files. OTOH at least Firefox seems to be able to do it some way.
  • The curl output is not affected, but it seems that any proxy configuration is omitted from the generated curl statements, so this might be a non-issue.

The option to use the SOCKS5h flavor is exposed next to the existing proxy options in the preferences:
Screenshot 2026-06-23 at 14 04 34

Contribution Checklist:

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

An error occurred during the review process. Please try again later.

Walkthrough

Adds socks5h as a supported proxy protocol across the stack: validation schemas in both the app-layer proxySchema and the Electron preferences store are extended, both ProxySettings UI components gain a new socks5h radio option with a tooltip, and a new test verifies setupProxyAgents routes through SocksProxyAgent with the socks5h:// scheme preserved.

Changes

socks5h Proxy Protocol Support

Layer / File(s) Summary
socks5h validation schema and UI radio options
packages/bruno-electron/src/store/preferences.js, packages/bruno-app/src/components/Preferences/ProxySettings/index.js, packages/bruno-app/src/components/CollectionSettings/ProxySettings/index.js
Extends Yup oneOf validation in both the electron preferences store and the app-level proxySchema to accept socks5h. Adds a socks5h radio input with a title tooltip to the manual proxy Protocol group in both ProxySettings components.
setupProxyAgents socks5h routing test
packages/bruno-electron/test/proxy-util.test.js
New Jest test case asserts that setupProxyAgents with proxyMode: 'on' and protocol: 'socks5h' calls getOrCreateHttpsAgent using SocksProxyAgent and a proxyUri with the socks5h:// scheme intact.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Suggested reviewers

  • helloanoop
  • bijin-bruno
  • naman-bruno
  • sid-bruno

Poem

🧦 A sock with a twist, resolving names far away,
socks5h joins the party — hip hip hooray!
Schema validated, tooltip gleaming bright,
The proxy agent routes each request just right.
Remote DNS in hand, the tunnel holds true. 🚇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding SOCKS5h protocol support with clarification on the key functional difference (domain name vs resolved IP).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/bruno-app/src/components/CollectionSettings/ProxySettings/index.js`:
- Around line 304-311: The radio input element with value="socks5h" in the
ProxySettings component is missing a data-testid attribute, which is required
for Playwright test automation. Add a data-testid attribute to this radio input
with a descriptive value that identifies it as the SOCKS5h protocol selector
(for example, something like "proxy-protocol-socks5h" or similar following the
existing naming conventions in the codebase).

In `@packages/bruno-app/src/components/Preferences/ProxySettings/index.js`:
- Around line 261-268: The radio input element for the SOCKS5h protocol option
(the input with value="socks5h" and name="config.protocol") is missing a
data-testid attribute required for Playwright test coverage. Add a data-testid
attribute to this radio input element with a descriptive test identifier
following the naming convention used in the component. This will allow test
selectors to target the element reliably without relying on brittle CSS or
attribute-based selectors.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 36a3f5b6-2fa7-4065-a4b2-09fb0ecaf2c8

📥 Commits

Reviewing files that changed from the base of the PR and between 3f69977 and 01214ea.

📒 Files selected for processing (4)
  • packages/bruno-app/src/components/CollectionSettings/ProxySettings/index.js
  • packages/bruno-app/src/components/Preferences/ProxySettings/index.js
  • packages/bruno-electron/src/store/preferences.js
  • packages/bruno-electron/test/proxy-util.test.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant