feat: bypass Apps Script tunnel for DoH endpoints on TCP/443#439
Merged
therealaleph merged 1 commit intotherealaleph:mainfrom Apr 28, 2026
Merged
Conversation
therealaleph
added a commit
that referenced
this pull request
Apr 28, 2026
…er errors Three substantive PRs from contributors landed for this release: - #443 by @euvel: optional spreadsheet-backed response cache in Code.gs. Implements all 5 review suggestions from the design discussion (#400): TTL-aware caching, 35 KB body-size gate, header rewriting on hit, circular buffer for O(1) writes, Vary-aware compound keys. - #439 by @dazzling-no-more: bypass Apps Script tunnel for known DoH endpoints on TCP/443. Cloudflare/Google/Quad9/AdGuard/NextDNS/OpenDNS/ CleanBrowsing/dns.sb/dns0.eu/AliDNS/doh.pub/Mullvad. Saves the ~2s UrlFetchApp roundtrip per name without losing privacy (DoH is already encrypted). Default on; users can opt out via tunnel_doh: true or extend the list via bypass_doh_hosts. - #438 by @dazzling-no-more: H1 container keepalive + 431 oversized- headers + clearer port-collision message. Cherry-picks from upstream Python (Apr 23-26 window). Keepalive prevents Apps Script V8 cold starts (visible as YouTube stalls after pause); 431 replaces silent socket drops on >64 KB headers (which caused browser retry loops).
Owner
|
Merged + included in v1.8.3 (just tagged). Builds clean, all 160 tests pass on main. Thanks for shipping this — exactly the kind of contribution that scales the project beyond what one maintainer can ship alone. v1.8.3 release page: https://github.com/therealaleph/MasterHttpRelayVPN-RUST/releases/tag/v1.8.3 Telegram channel announcement: https://t.me/mhrv_rs (will fire once release CI completes) Will tag you on the v1.9.0 xmux design issue when drafted (~1-2 weeks). [reply via Anthropic Claude | reviewed by @therealaleph] |
This was referenced Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In Full mode every browser DNS lookup over DoH was riding through the
Apps Script tunnel —
chrome.cloudflare-dns.com:443,dns.google:443and friends each paid the ~2 s
UrlFetchAppround-trip per name. Logsshowed this was the dominant per-flow overhead during page loads, yet
the tunnel adds no real privacy on top of DoH (queries are already
encrypted; the only marginal property is hiding the fact-of-DoH from
the local network). Route CONNECTs to known DoH hosts around the
tunnel via plain TCP instead.
src/proxy_server.rs: new
DEFAULT_DOH_HOSTScovering Cloudflare(incl. browser-pinned
chrome./mozilla./1dot1dot1dot1.variants), Google, Quad9, AdGuard, NextDNS, OpenDNS, CleanBrowsing,
dns.sb, dns0.eu, AliDNS, doh.pub, Mullvad.
matches_doh_host()iscase-insensitive and matches exactly OR as a dot-anchored suffix
unconditionally — symmetric for both the default list and user
extras. Hook in
dispatch_tunnelbetweenpassthrough_hosts(which still wins) and the Full / AppsScript mode branches; gated
to TCP/443 so a CONNECT to e.g.
dns.google:80doesn't getdiverted off-tunnel.
RewriteCtxcarriesbypass_dohandbypass_doh_hosts.ProxyServer::newwarns at startup whentunnel_doh: trueis paired with non-emptybypass_doh_hostssothe otherwise-silent inert combo is visible.
src/config.rs:
tunnel_doh: bool(defaultfalse= bypassactive) is the opt-out, and
bypass_doh_hosts: Vec<String>addsuser-supplied entries to the built-in list. Both
#[serde(default)]so existing configs keep working unchanged. Doc comments call out
the default direction, the TCP/443 gate (private DoH on
:8443should use
passthrough_hosts), and the inert combo.src/bin/ui.rs: round-trip both fields through
FormStateandConfigWireso Save doesn't drop user opt-outs / extras.android/.../ConfigStore.kt: mirror across
MhrvConfig,toJson(),encode(), andloadFromJson(). Write paths normalize entries(trim → drop empty → distinct) symmetric with the read path so
saved JSON and
mhrv-rs://hashes stay canonical.6 unit tests for
matches_doh_hostcovering exact, case /trailing-dot, suffix tenant subdomains, unrelated negatives,
extras extending the default, and the asymmetric-matching
footgun guard (user entries match subdomains without leading dot).