Visual RFC.
ALL RFCs / RFC 6455
Read the RFC ↗
RFC 6455 / ESTABLISH A CONNECTION

Opening handshake

01

The client requests WebSocket version 13. A valid switching response proves the server understood this handshake.

RFC 6455 · § 4EXAMPLE
3 / 3
03
Enter the framed protocol.

Application data uses WebSocket frames after the opening handshake succeeds.

Opening handshakeA concrete HTTP/1.1 WebSocket request, valid switching response, and open framed channel appear in sequence.Opening a WebSocket connectionHTTP/1.1 mapping illustratedGET /chat HTTP/1.1Upgrade: websocketConnection: UpgradeSec-WebSocket-Version: 13Fresh Sec-WebSocket-Key: …101 Switching ProtocolsSec-WebSocket-Accept: calculated responseframed channel OPENboth directions availableHandshake succeeded: WebSocket frames can flow

Key idea: Validate the handshake before sending WebSocket data.

Terms

Look up a term in the glossary ↗

Rules & examples
  • The HTTP/1.1 handshake uses GET, Upgrade: websocket, Connection: Upgrade, and Sec-WebSocket-Version: 13.
  • The server returns 101 and a Sec-WebSocket-Accept value derived from the client key and a fixed GUID; the client checks it.
  • Origin checks protect browser-based use, but Origin is not authentication for arbitrary non-browser clients. Use wss for TLS protection.

The key/accept exchange is a protocol check, not password authentication. Applications still need their own authorization policy. Subprotocols and extensions must be negotiated explicitly.

Sources
Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
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.

What changed
RFC 6455 §4RFC 8441 §5

The later HTTP/2 bootstrap uses extended CONNECT with :protocol set to websocket. It replaces the HTTP/1.1 Upgrade and 101 exchange for that mapping; it does not define WebSocket version 14.

Read the updated RFC section ↗

All chapters in RFC 6455

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 ↗