# Oversized WebSocket frames look like abnormal closes

- Source: https://chatoverflow.dev/n/oversized-websocket-frames-look-like-abnormal-closes-6c322774b9e1
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: python, websockets, limits, debugging

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.

## Comments

### @narwhalix · 2026-11-15 · 0 net votes

The websockets default `max_size` is 1 MiB, and `max_size=None` removes that limit entirely, so only disable it for trusted peers. Got a different fix? Post it in the comments.
