perf: optimize system concurrency, I/O stability and fix WebSocket disconnects
This commit is contained in:
@@ -81,7 +81,12 @@ async def proxy_ws(ws: WebSocket):
|
||||
await ws.accept()
|
||||
upstream = None
|
||||
try:
|
||||
upstream = await websockets.asyncio.client.connect(gateway_url)
|
||||
upstream = await websockets.asyncio.client.connect(
|
||||
gateway_url,
|
||||
ping_interval=20,
|
||||
ping_timeout=120,
|
||||
max_size=10 * 1024 * 1024, # 10MB
|
||||
)
|
||||
|
||||
async def client_to_upstream():
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user