Client masking
05Each client frame uses a new unpredictable masking key, repeated across its payload bytes.
The server uses the transmitted key; anyone observing the key can also undo the mask.
Key idea: Mask every client frame; use TLS for confidentiality.
Rules & examples
Mask every client frame; use TLS for confidentiality.
- The client chooses a fresh unpredictable 32-bit masking key for every frame, including control frames.
- Payload byte i is XORed with key byte i modulo 4. The receiver uses the same operation to recover it.
- Masking protects intermediaries from attacker-chosen wire patterns; the key travels with the frame, so masking does not hide content.
The byte example is deliberately tiny. Masked client frames and unmasked server frames are required even when TLS is used.
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.