One WebSocket frame, per RFC-6455 basic framing , has a maximum size limit of 2 ^ 63 bytes (9,223,372,036,854,775,807 bytes ~ = 9.22 exabytes) ( @Sebastian fix)
However, a WebSocket message consisting of 1 or more frames does not impose restrictions on it from the protocol level.
Each WebSocket implementation will handle message and frame boundaries differently. Such as setting the maximum message size for the entire message (usually for reasons of memory consumption) or providing the ability to stream large messages for better memory use.
But in your case, it is likely that your chosen WebSocket implementation has an error and incorrectly breaks the JSON message into multiple messages, rather than multiple frames. You can use the network validation tool in Chrome or an external tool like Wireshark to confirm this behavior.
Joakim Erdfelt
source share