Update tg_ws_proxy.py

This commit is contained in:
Flowseal 2026-03-27 07:42:41 +03:00 committed by GitHub
parent 9267416691
commit 24ffa955e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 4 deletions

View File

@ -965,7 +965,6 @@ async def _handle_client(reader, writer):
if dc is None and dst in _IP_TO_DC: if dc is None and dst in _IP_TO_DC:
dc, is_media = _IP_TO_DC.get(dst) dc, is_media = _IP_TO_DC.get(dst)
if dc in _dc_opt: if dc in _dc_opt:
# FIX: Negative DC for media connections, so the WS pool can distinguish them and use the correct domains.
init = _patch_init_dc(init, -dc if is_media else dc) init = _patch_init_dc(init, -dc if is_media else dc)
init_patched = True init_patched = True
@ -1069,14 +1068,13 @@ async def _handle_client(reader, writer):
splitter = None splitter = None
# Fix: Let the Splitter be As Is turned off for the main PC stream (as Flowseal asked in PR #415), # Turning splitter on for mobile clients or media-connections, so as the big files don't get fragmented by the TCP socket.
# but STRICTLY turning it On for media-connections (is_media), so as the big files don't get fragmented by the TCP socket.
if proto is not None and (init_patched or is_media or proto != _PROTO_INTERMEDIATE): if proto is not None and (init_patched or is_media or proto != _PROTO_INTERMEDIATE):
try: try:
splitter = _MsgSplitter(init, proto) splitter = _MsgSplitter(init, proto)
log.debug("[%s] MsgSplitter activated for proto 0x%08X", label, proto) log.debug("[%s] MsgSplitter activated for proto 0x%08X", label, proto)
except Exception: except Exception:
pass pass
# Send the buffered init packet # Send the buffered init packet
await ws.send(init) await ws.send(init)