mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-27 04:49:47 +01:00
fix: disable library WebSocket keepalive for device server
websockets.serve() defaults to ping_interval=20 and ping_timeout=20. ESP32 clients that do not answer those pings are dropped with 1011 keepalive ping timeout roughly 40 seconds into a healthy session. The application-level ping is configured separately via enable_websocket_ping. Refs #3348
This commit is contained in:
parent
c02becdc80
commit
eda3c23d51
1 changed files with 5 additions and 1 deletions
|
|
@ -74,7 +74,11 @@ class WebSocketServer:
|
||||||
port = int(server_config.get("port", 8000))
|
port = int(server_config.get("port", 8000))
|
||||||
|
|
||||||
async with websockets.serve(
|
async with websockets.serve(
|
||||||
self._handle_connection, host, port, process_request=self._http_response
|
self._handle_connection,
|
||||||
|
host,
|
||||||
|
port,
|
||||||
|
process_request=self._http_response,
|
||||||
|
ping_interval=None,
|
||||||
):
|
):
|
||||||
await asyncio.Future()
|
await asyncio.Future()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue