Skip to content

Commit fcd5e23

Browse files
author
root
committed
fix(proxy): remove redundant SNI list split
Keep PR scoped to UI checkbox for existing youtube_via_relay field. Drop behavior-neutral proxy refactor and config whitespace-only diff. Made-with: Cursor
1 parent ddf4196 commit fcd5e23

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

‎src/config.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ pub struct Config {
129129
/// features. Turn on and observe.
130130
#[serde(default)]
131131
pub normalize_x_graphql: bool,
132+
132133
/// Route YouTube traffic through the Apps Script relay instead of
133134
/// the direct SNI-rewrite tunnel. Ported from upstream Python
134135
/// `youtube_via_relay` (issue #102).

‎src/proxy_server.rs‎

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,14 @@ use crate::tunnel_client::TunnelMux;
3131
// User-Agent locking and no Apps Script quota.
3232
// When in doubt leave it out: sites that aren't actually on GFE will 404 or
3333
// return a wrong-cert error instead of loading.
34-
const SNI_REWRITE_CORE_SUFFIXES: &[&str] = &[
34+
const SNI_REWRITE_SUFFIXES: &[&str] = &[
35+
// Core Google
3536
"google.com",
3637
"gstatic.com",
3738
"googleusercontent.com",
3839
"googleapis.com",
39-
"doubleclick.net",
40-
"googlesyndication.com",
41-
"googleadservices.com",
42-
"google-analytics.com",
43-
"googletagmanager.com",
44-
"googletagservices.com",
4540
"ggpht.com",
46-
"blogspot.com",
47-
"blogger.com",
48-
];
49-
50-
const SNI_REWRITE_YOUTUBE_SUFFIXES: &[&str] = &[
41+
// YouTube family
5142
"youtube.com",
5243
"youtu.be",
5344
"youtube-nocookie.com",
@@ -59,6 +50,15 @@ const SNI_REWRITE_YOUTUBE_SUFFIXES: &[&str] = &[
5950
// traverse Apps Script instead of the direct GFE tunnel.
6051
"gvt1.com",
6152
"gvt2.com",
53+
// Ad + analytics infra. All on GFE, all previously broken the
54+
// same way YouTube was: SNI-blocked on Iranian DPI, but reachable
55+
// via `google_ip` with SNI rewritten.
56+
"doubleclick.net",
57+
"googlesyndication.com",
58+
"googleadservices.com",
59+
"google-analytics.com",
60+
"googletagmanager.com",
61+
"googletagservices.com",
6262
// fonts.googleapis.com is technically covered by the googleapis.com
6363
// suffix above, but mirroring Python's explicit listing makes the
6464
// intent obvious at a glance.
@@ -80,9 +80,8 @@ const YOUTUBE_SNI_SUFFIXES: &[&str] = &[
8080
fn matches_sni_rewrite(host: &str, youtube_via_relay: bool) -> bool {
8181
let h = host.to_ascii_lowercase();
8282
let h = h.trim_end_matches('.');
83-
SNI_REWRITE_CORE_SUFFIXES
83+
SNI_REWRITE_SUFFIXES
8484
.iter()
85-
.chain(SNI_REWRITE_YOUTUBE_SUFFIXES.iter())
8685
.filter(|s| {
8786
// If the user opted into youtube_via_relay, skip YouTube
8887
// suffixes so they fall through to the Apps Script relay

0 commit comments

Comments
 (0)