This commit is contained in:
Flowseal
2026-06-17 10:25:45 +03:00
parent 96e5b4b639
commit e40c571009
4 changed files with 7 additions and 2 deletions
+4 -1
View File
@@ -275,6 +275,9 @@ async def _ws_keepalive(ws, interval: float):
"""
if interval <= 0:
return
interval = max(1.0, interval) # reasonable minimum
try:
while True:
await asyncio.sleep(interval)
@@ -354,7 +357,7 @@ async def bridge_ws_reencrypt(reader, writer, ws: RawWebSocket, label,
tasks = [asyncio.create_task(tcp_to_ws()),
asyncio.create_task(ws_to_tcp())]
keepalive = asyncio.ensure_future(
keepalive = asyncio.create_task(
_ws_keepalive(ws, proxy_config.ws_keepalive_interval))
try:
await asyncio.wait(tasks, return_when=asyncio.FIRST_COMPLETED)