Visual RFC.
ALL RFCs / RFC 8441
Read the RFC ↗
RFC 8441 / WEBSOCKETS ON HTTP/2

Carry WebSocket frames in DATA

03

WebSocket frames remain WebSocket frames. Their bytes travel inside HTTP/2 DATA on the connected stream.

RFC 8441 · § 5EXAMPLE
3 / 3
Carry WebSocket frames in DATAThe RFC6455 masked Hello frame contains11bytes:8185, mask37FA213D and masked payload7F9F4D5158. Two hypothetical HTTP/2 DATA payloads on stream3 carry5and6bytes, splitting the masking key. Concatenation preserves the WebSocket frame; XOR with the repeated key recoversHello. HTTP/2 headers and padding are excluded, and masking is not encryption.A WebSocket frame is carried as stream bytesRFC6455 Hello vector · client → serverWebSocket frame · 11 bytes · schematic81 85 37 FA 21 3D 7F 9F 4D 51 582 header bytes + 4 mask bytes + 5 payload bytesHTTP/2 DATA payloads · stream 381 85 37 FA 213D 7F 9F 4D 51 58Join bytes, parse frame, XOR payloadHello
03
Read the stream and decode the WebSocket frame.

The receiver joins the byte stream, reads the four-byte key and XORs the five masked payload bytes to recover Hello. HTTP/2 delivery does not eliminate WebSocket parsing.

Source for this drawing: RFC 8441 · Read RFC section 5 ↗

Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

A message needs an address.

Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.

Helpful first, if these ideas are unfamiliar

These pictures are analogies to help you learn. The linked RFC explains the actual rules.

Terms in this drawing
DATA
An HTTP/2 frame type carrying stream-associated bytes, subject to flow control.
Mask
A four-byte key XORed with client WebSocket payload bytes.
FIN
A WebSocket flag marking the final frame of a message; unrelated to HTTP/2 END_STREAM.
Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

KEY POINT

HTTP/2 boundaries do not replace WebSocket framing.

  • Treat the successfully connected HTTP/2 stream like the TCP byte connection used by RFC6455. Its DATA carries the traditional WebSocket protocol.
  • Client frames MUST be masked under the retained RFC6455 rules, even with TLS. A fresh unpredictable masking key is required per frame; the public Hello vector is a worked example, not a reusable key.
  • HTTP/2 DATA boundaries need not match WebSocket frame boundaries. The 11-byte example is split into 5 and 6 data bytes; HTTP/2 frame headers and optional padding are not shown.
DETAILS

Supporting RFC6455§§5.1,5.3,5.7 and10.3 define framing and masking; RFC9113§6.1 defines DATA. The mask hides an application’s choice of wire bytes from intermediaries; it is not encryption or authentication. This example has FIN=1, text opcode=1, a five-byte payload and no negotiated extensions.

Read the RFC section ↗

All chapters in RFC 8441

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗