Frame fields
03FIN, opcode, mask state, length, and optional masking key let the receiver interpret one frame.
In this illustrated client text frame, unmask five bytes to recover Hello.
Key idea: Read control fields before interpreting the payload.
Rules & examples
Read control fields before interpreting the payload.
- FIN marks the final fragment; opcode identifies continuation, text, binary, or a control frame. Reserved bits are zero unless an extension defines them.
- Payload lengths 0–125 fit directly; 126 and 127 introduce extended-length fields. The high bit of a 64-bit length must be zero.
- Client-to-server frames set MASK and carry a 32-bit masking key; server-to-client frames are not masked.
A single message can span multiple frames. Payload length includes extension data when extensions add it; implementations should impose appropriate resource limits.
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.