This commit is contained in:
Flowseal
2026-09-03 20:17:46 +03:00
parent e8ad0d6958
commit 492d999248
+2 -2
View File
@@ -28,7 +28,7 @@ class _WsPool:
self._rotating: Dict[Tuple[int, bool], asyncio.Task] = {} self._rotating: Dict[Tuple[int, bool], asyncio.Task] = {}
self._refill_failures: Dict[Tuple[int, bool], int] = {} self._refill_failures: Dict[Tuple[int, bool], int] = {}
self._refill_after: Dict[Tuple[int, bool], float] = {} self._refill_after: Dict[Tuple[int, bool], float] = {}
self.try_fronting_first = False # TODO: https://github.com/Flowseal/tg-ws-proxy/issues/1232 self.try_fronting_first = True
async def get(self, dc: int, is_media: bool, async def get(self, dc: int, is_media: bool,
target_ip: str, domains: List[str] target_ip: str, domains: List[str]
@@ -167,7 +167,7 @@ class _WsPool:
target_ip, domain, timeout=8) target_ip, domain, timeout=8)
self.try_fronting_first = False self.try_fronting_first = False
return ws return ws
except asyncio.TimeoutError: except (asyncio.TimeoutError, ConnectionResetError):
if self.try_fronting_first: if self.try_fronting_first:
return None return None
return await self._connect_fronted(target_ip, domain) return await self._connect_fronted(target_ip, domain)