fix: Add exit node bypass suffixes for optimized routing in DomainFronter

This commit is contained in:
Abolfazl
2026-05-13 14:43:33 +03:30
parent 00edfe95c2
commit 6745dd167f
2 changed files with 10 additions and 5 deletions
+9 -3
View File
@@ -110,6 +110,7 @@ class DomainFronter:
"sec-fetch-site",
)
_SAFE_RETRY_METHODS = {"GET", "HEAD", "OPTIONS"}
_EXIT_NODE_BYPASS_SUFFIXES = ("googlevideo.com",)
_APPS_SCRIPT_DEFAULT_LANG = "en"
def __init__(self, config: dict):
@@ -1389,12 +1390,17 @@ class DomainFronter:
"""Return True if this URL should be routed through the exit node."""
if not self._exit_node_enabled or not self._exit_node_url:
return False
if self._exit_node_mode == "full":
return True
# selective: check if destination hostname matches configured list
host = self._host_key(url)
if not host:
return False
# googlevideo flows are large/CPU-heavy; keep them on direct Google relay
# and never chain through Cloudflare/Deno/VPS exit nodes.
if any(host == suffix or host.endswith("." + suffix)
for suffix in self._EXIT_NODE_BYPASS_SUFFIXES):
return False
if self._exit_node_mode == "full":
return True
# selective: check if destination hostname matches configured list
for pattern in self._exit_node_hosts:
if host == pattern or host.endswith("." + pattern):
return True
+1 -2
View File
@@ -250,8 +250,7 @@ def _build_502_html(message: str) -> str:
gap: 8px;
}}
.resource-title {{
font-size: 0.72em;
text-transform: uppercase;
font-size: 0.82em;
letter-spacing: 0.08em;
color: #93c5fd;
margin-right: 6px;