WebSocket RFC 6455: the protocol for real-time web

WebSocket RFC 6455 (December 2011): IETF standard protocol for browser-server full-duplex communication over TCP. HTTP handshake, binary framing, universal browser support since 2012. Foundation of web chat, trading, gaming.

Open SourceWeb WebSocketRFC 6455IETFReal-timeHTTPOpen SourceWeb

The limit of polling

Before WebSocket, “real-time” communication between browser and server is achieved with workarounds:

  • Short polling — client repeats HTTP requests every N seconds
  • Long polling — HTTP request held open until event
  • Comet — HTTP streaming techniques
  • Server-Sent Events (2006-2009) — unidirectional server→client

None is efficient for bidirectional low-latency communication (chat, trading, gaming, live dashboard).

The release

RFC 6455 is published by the IETF in December 2011. Main authors: Ian Fette (Google), Alexey Melnikov. The protocol had been introduced in draft in 2008 by Ian Hickson (HTML5 spec) and Michael Carter.

The final draft is worked on by a working group including browser vendors, Apache Foundation, other implementers.

How it works

  1. HTTP Upgrade handshake — client sends GET with Upgrade: websocket header
  2. Server responds 101 Switching Protocols
  3. Persistent TCP connection — after handshake, binary WebSocket frames
  4. Framing — text/binary/close/ping/pong frames with client→server masking
  5. URI schemews:// (plaintext) or wss:// (TLS)
const ws = new WebSocket('wss://api.example.com/stream');
ws.onmessage = (e) => console.log(e.data);
ws.send(JSON.stringify({ action: 'subscribe' }));

Browser adoption

  • Chrome 14 (September 2011) — final support
  • Firefox — support expected in the 2012 releases
  • Safari — on the WebKit roadmap

Universal availability is expected by the second half of 2012 as these browsers ship.

Libraries and frameworks

The protocol is rapidly adopted:

  • Socket.IO (2010, fallback for legacy browsers)
  • ws — Node.js library, faster
  • Phoenix Channels (Elixir)
  • SignalR (.NET)
  • Django Channels (Python)
  • ActionCable (Rails 5)
  • Spring WebSocket (Java)

Use cases

  • Chat — Slack, Discord, WhatsApp Web
  • Trading — real-time orderbook, live prices
  • Gaming — online multiplayer
  • Collaboration — Google Docs, Figma, Notion
  • Live dashboard — monitoring, observability
  • IoT — telemetry, remote control
  • Push notifications — web apps

In the Italian context

WebSocket is positioning itself as the foundation for Italian real-time applications: fintech and online trading, health monitoring, SaaS collaboration and online gaming are starting to design architectures around a persistent bidirectional channel.


References: RFC 6455 (December 2011). IETF. Ian Fette (Google), Alexey Melnikov. ws://, wss:// schemes.

Need support? Under attack? Service Status
Need support? Under attack? Service Status