System Design Space
Knowledge graphSettings

Updated: March 2, 2026 at 11:20 PM

WebSocket protocol

mid

Duplex channel over HTTP Upgrade: connection establishment and real-time messaging.

Source

WebSocket

Definition of the protocol, upgrade and messaging features.

Перейти на сайт

WebSocket is an application layer protocol that opens a persistent two-way communication channel between a client and a server. It is built on top of HTTP Upgrade and is suitable for scenarios where frequent updates and minimal latency are needed.

How WebSocket works

Upgrade from HTTP

The connection starts as a normal HTTP request and switches to a WebSocket via Upgrade headers.

Full duplex

The client and server can send messages independently and simultaneously.

Long-lived connections

The channel remains open, reducing the overhead of reconnections.

Message Frames

Data is sent as WebSocket frames with a type and payload.

Upgrade and Messaging

First, a regular HTTP connection is upgraded to WebSocket, after which the channel becomes permanent and supports the exchange of messages in both directions.

HTTP → WebSocket Upgrade

Click a step or use the controls to replay the upgrade and message exchange

State

Click "Start" to see the transition process from HTTP to WebSocket.

ClientServer
Client
-
Server

The connection is open and ready for message exchange.

Details

Key headers and message examples will appear here.

Where WebSocket fits best

  • Chats and collaborative editors
  • Live dashboards and monitoring
  • Online games and realtime interaction
  • Trade and financial flows
  • Signaling for WebRTC

Example tasks and related chapters

Enable tracking in Settings

System Design Space

© 2026 Alexander Polomodov