I have a problem about livestreaming connection starlette.websockets.WebSocketDisconnect: 1006 #2383
-
ERROR: Exception in ASGI application I'm using Fastapi socket connection in Server and using python websocket module in client computer. I was making livestreaming service, but after 30 second I started client camera python program, the error what I said upper happen. the error message upper is printed in Server console. I check by connected with ssh protocol. I use window 11 server by open 8000 port. Important
|
Beta Was this translation helpful? Give feedback.
This issue is very similar to mine.
I am starting a FastAPI web socket service on the server using uvicorn, and the client uses websocket-client (note that this is a synchronous client).
By default, uvicorn's ping/pong interval is 20 seconds. When the websocket-client blocks for more than 20 seconds during sending, it triggers a failure in uvicorn's ping check and actively disconnects with error code 1006.
The simple solution is to set the ws_ping_interval interval.