feat(youtube): relay_url_patterns + SABR strip + exit-node-full SNI#977
feat(youtube): relay_url_patterns + SABR strip + exit-node-full SNI#977dazzling-no-more wants to merge 1 commit intotherealaleph:mainfrom
Conversation
|
Reviewed via Anthropic Claude. Read the PR body + structural diff. Big PR, three independent strands bundled. Let me address each: 1. 2. SABR query-string strip. 3. exit-node SNI for full mode. +2722 / -31 across UI + config + domain_fronter + proxy_server + Android Kotlin — substantial. The structural changes look well-scoped (each strand is in its own module), but I want to sanity-check the regression surface. Plan: leaving open for 5–7 days community testing (same path as #903 / #359). Specifically asking testers to verify:
Code-wise — will do a closer read on:
Verified locally that build is clean + tests pass on top of v1.9.18:
Thanks @dazzling-no-more — this is exactly the right strand of work to be cutting through. Will pre-test myself on the SABR strip claim and report back here. |
w0l4i
left a comment
There was a problem hiding this comment.
Great commit, clever move !
keep it going champ 💪
Summary
Ports three upstream YouTube fixes from the Python project (
masterking32/MasterHttpRelayVPN) and rewires routing inMode::AppsScriptso they cooperate with the existing exit-node, fronting-group, andyoutube_via_relayfeatures.9b6d03e+33db28a) — strips top-level field-3 entries from/videoplaybackPOST bodies on*.googlevideo.com/*.youtube.com. Fixes "Response too large" 502s on multi-track segment fetches that exceed Apps Script'sUrlFetchApp10 MB cap. Heuristic only fires on segment-fetch shape (field-2 present) so session-init bodies stay intact.relay_url_patternspath-pinned relay routing (upstreamb3b9220) — new config field. Defaultyoutube.com/youtubei/is prepended at startup so YouTube's in-page RPC (where SafeSearch / live-stream gating decisions land) goes through the Apps Script relay, while non-/youtubei/paths fall through to a fresh SNI-rewrite TLS connection. Recovers the SafeSearch fix that previously required the heavyweightyoutube_via_relay = trueknob, at ~1% of the quota cost.88b2767) — whenexit_node.mode = "full"is active inapps_scriptmode, YouTube hosts are pulled out of the SNI-rewrite suffix list so every YT request lands inDomainFronter::relayand routes through the second-hop exit node, restoring the documented "every URL routes through the exit node" contract.What's in the diff
relay_url_patterns: Vec<String>(with fullConfig::validate()coverage of thehost/path-prefixshape — empty hosts, RFC 1123 label rules, oversized labels, etc.).ResolvedRoutingstruct that resolves patterns + force-MITM hosts at startup, gated toMode::AppsScriptonly (Mode::Direct and Mode::Full intentionally inert — neither has a relay path the filter could route through).forward_via_sni_rewrite_httphelper for non-matching paths on path-pinned hosts. Dialsgoogle_ip:443withSNI=front_domainand sends the realHostheader; gated to safe methods (GET / HEAD / OPTIONS) to avoid replay risk on POST/PUT/PATCH; gated off entirely whenexit_node.mode = "full"so the bypass path can't undermine the exit node.SABR strip + url_host_is_youtube_video_endpointhost gate so unrelated services exposing/videoplaybackdon't get their bodies rewritten.tracing::warn!s for: patterns whose host isn't SNI-rewrite-capable (forwarder would return wrong-origin from the Google edge — pattern preserved but force-MITM skipped); patterns dropped because a YT-host pattern conflicts withyoutube_via_relay = true; fronting-group domains overlapping force-MITM hosts (group dispatch wins, path filter inert).ConfigStoreround-trip) + AndroidMhrvConfigparity — newrelay_url_patternsfield is round-tripped through both wire formats and themhrv-rs://share/import path. No UI editor (power-user knob likepassthrough_hosts).Test plan
cargo build --binscleancargo test --lib— 268 passed (67 new); covers SABR strip parsing, host gate, URL pattern + force-MITM matchers (incl. trailing-dot, port-in-authority, case), SNI-capable filter, RFC 1123 host validation,ResolvedRoutingper-mode behavior (AppsScript / Direct / Full), exit-node-full + user-pattern interactions, fronting-group precedence, forwarder request rebuilding (chunked → freshContent-Length, hop-by-hop drop, port handling, POST empty-body framing).