Skip to content

fix(browser): remote tunnel matches Chromium for IPv6 bypass rules and <-loopback> - #32665

Merged
AmoabaKelvin merged 2 commits into
mainfrom
tunnel-proxy-bypass-parity
Oct 24, 2026
Merged

AmoabaKelvin merged 2 commits into
mainfrom
tunnel-proxy-bypass-parity

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​14 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​13
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​25 $\color{#cf222e}{\Huge{\mathbf{−}}}$​17 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​8

ELI5

When you browse through a remote Orca server, the server decides for each connection whether to go through its proxy or connect directly. It now makes that call the same way the server's own browser does when the bypass list has an IPv6 address or <-loopback> in it.

What Changed

Before:

  • A bypass rule like [fd00::1] never matched, because the SOCKS front end hands IPv6 destinations over as fd00:0:0:0:0:0:0:1 and the rule was compared as text. The request went through the proxy.
  • <-loopback> was ignored. The tunnel always connected to localhost and loopback directly, while Chromium on the server sends them through the proxy when that rule is set.
  • Link-local destinations (169.254.0.0/16, fe80::/10) went through the proxy. Chromium bypasses these implicitly.

After, in matchesProxyBypassRules:

  • IP-literal rules compare as addresses (through the existing matchesCidr/BlockList), so compressed, expanded, bracketed and upper-case forms all match.
  • The implicit bypass set (localhost, loopback, link-local) moved out of selectBrowserNetworkTunnelProxy and into the matcher. It now works as Chromium's fallback after the explicit rules: the last matching rule wins, and <-loopback> removes the implicit bypass for the hosts it covers. So <-loopback>;<local> still bypasses localhost, and <local>;<-loopback> proxies it, the same as Chromium.

Why

Root cause: the tunnel's bypass matcher decided on its own, outside Chromium's rule model. It compared IP literals as strings, and it applied the implicit loopback bypass before the rule list, so no rule could remove it.

The fix copies Chromium's evaluator (net/proxy_resolution/proxy_host_matching_rules.cc and net/base/scheme_host_port_matcher.cc: reverse iteration with first match, SubtractImplicitBypassesRule, and MatchesImplicitRules as the fallback, which includes link-local). I left formatIpv6 alone: rules can be written in any form, so canonicalizing only the target would fix one side.

<-loopback> applies to NO_PROXY too, because the server's own Chromium sessions get NO_PROXY unchanged and honor it there.

Linked Issue

Fixes #29448

Linear: STA-10760

Visual Proof

N/A: this changes main-process proxy selection for tunneled connections, and there is no UI.

Testing

  • pnpm test src/main/browser/browser-network-tunnel-proxy.test.ts: new table rows cover an expanded IPv6 target against a compressed bracketed rule, an expanded rule against a bracketed upper-case target, implicit link-local, <-loopback> alone, and both orders of <local> with <-loopback>. A selector-level case checks that <-loopback> proxies 127.0.0.1. The existing IPv4, hostname, CIDR and NO_PROXY rows are unchanged and pass.

  • With the old selection file restored, 6 of the new cases fail.

  • pnpm run check:code-quality:changed and pnpm run check:react-doctor:changed pass.

  • Automated tests added/updated

Notes

  • No wire change. Older clients send the same host strings, and the server owns the decision.
  • Follow-up I didn't take on: Chromium on Windows also bypasses the hostname loopback implicitly.

@AmoabaKelvin
AmoabaKelvin marked this pull request as ready for review October 23, 2026 21:45
@AmoabaKelvin
AmoabaKelvin force-pushed the tunnel-proxy-bypass-parity branch from db4037a to b7bc1f8 Compare October 23, 2026 21:47
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7b333bda-2121-441d-b37a-6b2084d9b599
📥 Commits

Reviewing files that changed from the base of the PR and between b7bc1f8 and 34cf880.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Proxy selection now evaluates configured bypass rules for loopback and eligible local-certificate hosts. Implicit bypass matching includes IPv4 and IPv6 link-local addresses. The last matching rule determines the result, and <-loopback> can subtract an implicit bypass. IP-literal rules match exact IPv4 or IPv6 addresses. Tests cover IPv6 address equivalence, host matching, link-local matching, and bypass-rule ordering.

Priority: ⬇️ Low

Severity of issue fixed: Low

Merge Risk: 🔵 Low · up to b7bc1

A narrow trailing-dot rule combination can bypass the configured proxy. The change is otherwise mergeable with this known limitation accepted or fixed.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: aligning browser tunnel proxy behavior with Chromium for IPv6 bypass rules and <-loopback>.
Description check Passed The description is complete and focused. It includes the user-facing explanation, changed behavior, rationale, linked issue, visual-proof status, testing details, and compatibility notes. Some optiona…
Linked Issues check Passed The changes satisfy both coding requirements in #29448. matchesBypassRule now compares IP literals through matchesCidr and BlockList, so equivalent IPv6 forms match. matchesProxyBypassRules ev…
Out of Scope Changes check Passed The production change is limited to tunnel proxy bypass evaluation. The implicit link-local ranges and reverse rule evaluation support the stated Chromium-compatible fallback model. The test changes c…
Full details: Description check

Explanation

The description is complete and focused. It includes the user-facing explanation, changed behavior, rationale, linked issue, visual-proof status, testing details, and compatibility notes. Some optional checklist sections are not explicitly completed, but the required change and validation details are present.

Full details: Linked Issues check

Explanation

The changes satisfy both coding requirements in #29448. matchesBypassRule now compares IP literals through matchesCidr and BlockList, so equivalent IPv6 forms match. matchesProxyBypassRules evaluates the implicit bypass after explicit rules and lets &lt;-loopback&gt; remove the loopback exemption. Tests cover expanded and compressed IPv6 forms and proxy selection for 127.0.0.1 with &lt;-loopback&gt;.

Full details: Out of Scope Changes check

Explanation

The production change is limited to tunnel proxy bypass evaluation. The implicit link-local ranges and reverse rule evaluation support the stated Chromium-compatible fallback model. The test changes cover those matcher behaviors. No unrelated files or unrelated product behavior are present.

✨ Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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: 1


ℹ️ Review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 64d45e2c-c667-4018-b38f-0ee50827b3e4
📥 Commits

Reviewing files that changed from the base of the PR and between b9700e4 and b7bc1f8.

📒 Files selected for processing: 2
  • src/main/browser/browser-network-tunnel-proxy-selection.ts
  • src/main/browser/browser-network-tunnel-proxy.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Comment on lines +80 to +81
.findLast((rule) =>
rule === '<-loopback>' ? implicit : matchesBypassRule(host, target.port, rule, style)

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Preserve the trailing dot when matching <local>.

If the target is localhost. and the rules are <-loopback>;<local>, normalizeHost removes the dot before matchesBypassRule checks <local>. The last rule then selects a direct connection. Chromium does not match <local> against a hostname with a trailing dot, so this combination should select the proxy. Keep the original hostname’s trailing-dot state for the <local> check while retaining normalization for the other rules. (chromium.googlesource.com)

@AmoabaKelvin
AmoabaKelvin force-pushed the tunnel-proxy-bypass-parity branch from b7bc1f8 to 34cf880 Compare October 23, 2026 22:09
@AmoabaKelvin
AmoabaKelvin merged commit 117e186 into main Oct 24, 2026
33 checks passed
@AmoabaKelvin
AmoabaKelvin deleted the tunnel-proxy-bypass-parity branch October 24, 2026 02:35
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.

Remote browser tunnel proxy: IPv6 literal bypass rules and <-loopback> differ from Chromium

1 participant