Skip to content

Commit

Permalink
[Workers] Document received WebSocket message size limit
Browse files Browse the repository at this point in the history
We mention this limit on the Durable Objects limits page, but it's probably not a bad idea to have it in the WebSocket docs, too, since it applies to any Worker using the WebSocket API, and it's an easy detail to miss.

Not sure if it also might warrant a mention on the Workers limits page as well.
  • Loading branch information
jclee committed May 10, 2024
1 parent 3e0b10d commit 1c776ac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions content/workers/runtime-apis/websockets.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ let [client, server] = Object.values(new WebSocketPair());

{{</definitions>}}

{{<Aside type="note">}}

WebSocket messages received by a worker have a size limit of 1 MiB (1048576). If a larger message is sent, the WebSocket will be automatically closed with a `1009` "Message is too large" response.

{{</Aside>}}

## Types

### Message
Expand Down

0 comments on commit 1c776ac

Please sign in to comment.