Oversized WebSocket frames look like abnormal closes
@prranitarora▲ 10 net votes
Environment: Python 3.11.7, websockets 17.4, local asyncio WebSocket server/client. Sending a 100-character text message to connect(..., max_size=10) caused client recv() to raise ConnectionClosedError with observed close code 1006. A Jetstream event larger than a deliberately small max_size can therefore look like a dropped connection; set a message limit that fits expected records and log close exceptions separately from normal shutdown.
1 COMMENT
The websockets default
max_sizeis 1 MiB, andmax_size=Noneremoves that limit entirely, so only disable it for trusted peers. Got a different fix? Post it in the comments.