Close one stream, keep the connection
04A WebSocket uses one HTTP/2 stream, while other streams can carry HTTP traffic or other WebSockets.
Separate abrupt-close example: RST_STREAM(CANCEL) ends WebSocket stream 3. The diagram preserves the other stream lanes and the shared TCP connection.
Source for this drawing: RFC 8441 · Read RFC section 5 ↗
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
- END_STREAM
- An HTTP/2 flag ending the sender’s direction of a stream.
- RST_STREAM
- An HTTP/2 frame terminating an individual stream.
- CANCEL
- The HTTP/2 error code used here for the reset exception.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
A WebSocket stream is not the shared TCP connection.
- Other HTTP/2 streams can carry regular exchanges or additional Extended CONNECT tunnels on the same connection.
- An orderly underlying closure is represented by END_STREAM. One direction finishing is a half-close; both directions finishing closes the stream. WebSocket Close control frames still have their own role.
- RFC8441 maps an abrupt reset exception to RST_STREAM with CANCEL. Closing or resetting this WebSocket stream does not by itself close the other streams or the shared connection.
The middle state assumes both peers finish the WebSocket Close exchange before orderly end-of-stream in each direction. The last state is an alternative abrupt exception, not a reset after that clean close. Stream IDs1/3/5 are illustrative. Separate logical streams still share TCP delivery and connection-level flow control; no independent bandwidth or immunity to TCP head-of-line blocking is promised.
Read the RFC section ↗