Skip to content

Commit 6745dd1

Browse files
committed
fix: Add exit node bypass suffixes for optimized routing in DomainFronter
1 parent 00edfe9 commit 6745dd1

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/relay/domain_fronter.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ class DomainFronter:
110110
"sec-fetch-site",
111111
)
112112
_SAFE_RETRY_METHODS = {"GET", "HEAD", "OPTIONS"}
113+
_EXIT_NODE_BYPASS_SUFFIXES = ("googlevideo.com",)
113114
_APPS_SCRIPT_DEFAULT_LANG = "en"
114115

115116
def __init__(self, config: dict):
@@ -1389,12 +1390,17 @@ def _exit_node_matches(self, url: str) -> bool:
13891390
"""Return True if this URL should be routed through the exit node."""
13901391
if not self._exit_node_enabled or not self._exit_node_url:
13911392
return False
1392-
if self._exit_node_mode == "full":
1393-
return True
1394-
# selective: check if destination hostname matches configured list
13951393
host = self._host_key(url)
13961394
if not host:
13971395
return False
1396+
# googlevideo flows are large/CPU-heavy; keep them on direct Google relay
1397+
# and never chain through Cloudflare/Deno/VPS exit nodes.
1398+
if any(host == suffix or host.endswith("." + suffix)
1399+
for suffix in self._EXIT_NODE_BYPASS_SUFFIXES):
1400+
return False
1401+
if self._exit_node_mode == "full":
1402+
return True
1403+
# selective: check if destination hostname matches configured list
13981404
for pattern in self._exit_node_hosts:
13991405
if host == pattern or host.endswith("." + pattern):
14001406
return True

src/relay/relay_response.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,7 @@ def _build_502_html(message: str) -> str:
250250
gap: 8px;
251251
}}
252252
.resource-title {{
253-
font-size: 0.72em;
254-
text-transform: uppercase;
253+
font-size: 0.82em;
255254
letter-spacing: 0.08em;
256255
color: #93c5fd;
257256
margin-right: 6px;

0 commit comments

Comments
 (0)