Removed dc overriding

This commit is contained in:
Flowseal 2026-04-07 15:56:46 +03:00
parent 15001980dc
commit 081b150b3d
1 changed files with 1 additions and 3 deletions

View File

@ -26,7 +26,6 @@ class ProxyConfig:
host: str = '127.0.0.1' host: str = '127.0.0.1'
secret: str = field(default_factory=lambda: os.urandom(16).hex()) secret: str = field(default_factory=lambda: os.urandom(16).hex())
dc_redirects: Dict[int, str] = field(default_factory=lambda: {2: '149.154.167.220', 4: '149.154.167.220'}) dc_redirects: Dict[int, str] = field(default_factory=lambda: {2: '149.154.167.220', 4: '149.154.167.220'})
dc_overrides: Dict[int, int] = field(default_factory=lambda: {203: 2})
buffer_size: int = 256 * 1024 buffer_size: int = 256 * 1024
pool_size: int = 4 pool_size: int = 4
fallback_cfproxy: bool = True fallback_cfproxy: bool = True
@ -478,7 +477,6 @@ class _MsgSplitter:
def _ws_domains(dc: int, is_media) -> List[str]: def _ws_domains(dc: int, is_media) -> List[str]:
dc = proxy_config.dc_overrides.get(dc, dc)
if is_media is None or is_media: if is_media is None or is_media:
return [f'kws{dc}-1.web.telegram.org', f'kws{dc}.web.telegram.org'] return [f'kws{dc}-1.web.telegram.org', f'kws{dc}.web.telegram.org']
return [f'kws{dc}.web.telegram.org', f'kws{dc}-1.web.telegram.org'] return [f'kws{dc}.web.telegram.org', f'kws{dc}-1.web.telegram.org']
@ -958,7 +956,7 @@ async def _handle_client(reader, writer, secret: bytes):
media_tag = " media" if is_media else "" media_tag = " media" if is_media else ""
# Fallback if DC not in config or WS blacklisted for this DC/is_media # Fallback if DC not in config or WS blacklisted for this DC/is_media
if dc not in proxy_config.dc_redirects or dc_key in ws_blacklist: if dc not in proxy_config.dc_redirects or dc_key in ws_blacklist or dc == 2 and is_media:
if dc not in proxy_config.dc_redirects: if dc not in proxy_config.dc_redirects:
log.info("[%s] DC%d not in config -> fallback", log.info("[%s] DC%d not in config -> fallback",
label, dc) label, dc)