Fragments and control frames
04A large message can be fragmented while Ping and Pong remain responsive between fragments.
The final continuation completes the text message in fragment order.
Key idea: Keep control frames independent from message fragments.
Rules & examples
Keep control frames independent from message fragments.
- A fragmented message begins with text/binary and FIN=0, continues with opcode 0, and ends with FIN=1.
- Control frames cannot be fragmented and have at most 125 payload bytes. They may appear between message fragments.
- A Ping normally requires a Pong response with the same application data, unless a Close was already received.
Without an extension defining it, fragments of different data messages are not interleaved. An unsolicited Pong is permitted and does not require a response.
Sources
New to this? Start hereA quick picture + helpful background
A request starts a conversation.
A client asks for a resource. A server sends a response. The method, address, headers, and status explain what that conversation means.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.