WebSockets

WebSocket (RFC 6455, IETF, Dec 2011) gives full-duplex framing over one TCP connection reached via an HTTP Upgrade handshake; the browser JS API is a separate WHATWG Living Standard, last revised March 2026. It's a royalty-free open protocol (no license fee), supported by roughly 97% of browsers per caniuse (96.93% global usage) and every browser shipped since 2013. Framing overhead is 2-6 bytes per message after handshake, versus roughly 600 bytes of headers on a comparable HTTP request, the reason it beats polling and SSE under high message frequency. Extensions add permessage-deflate compression (RFC 7692), HTTP/2 bootstrapping (RFC 8441), and HTTP/3 (RFC 9220). Node's `ws` package alone logs roughly 224M npm downloads/week in 2026; Socket.IO, its most common wrapper, layers in automatic transport fallback. Current version/status: RFC 6455 wire protocol (Dec 2011, unchanged); WHATWG browser API Living Standard, last revised March 2026. License: Open IETF/WHATWG standard, royalty-free, no license required. Maintained by IETF (wire protocol, RFC 6455) and WHATWG (browser JavaScript API, Living Standard).

Also known as: WebSocket, WS, Web Sockets, Socket.IO (common library), RFC 6455
🧊Why learn WebSockets?

Pick WebSocket when you need low-latency, high-frequency, bidirectional traffic through a browser: multiplayer state sync, trading tickers, collaborative editors, where SSE's one-way stream or MQTT's broker overhead don't fit. Skip it for simple server-push (stock ticker, notification feed): SSE rides plain HTTP, auto-reconnects, and survives corporate proxies that WebSocket's upgrade handshake can get blocked by, at a fraction of the code. Skip it for constrained IoT fleets too: MQTT's 2-byte header and QoS levels beat WebSocket's chattier framing on cellular/LPWAN links. The protocol's own acknowledged weakness: no built-in reconnection, backpressure, or message framing beyond raw bytes/text, so production use almost always means bolting on a library like Socket.IO or hand-rolling a reconnect/heartbeat layer. Known weakness: The spec defines only framing and a handshake, not reconnection, backpressure, or message semantics, so every real deployment ends up shipping a wrapper library or hand-rolled heartbeat/reconnect logic on top.

See how it ranks →

Compare WebSockets

Learning Resources

Related Tools

Alternatives to WebSockets

Other API Protocols

View all →
6LoWPAN
6LoWPAN (IPv6 over Low-Power Wireless Personal Area Networks) is a networking protocol that enables IPv6 communication over low-power, low-data-rate wireless networks, such as those used in IoT devices. It compresses IPv6 packets to fit within the constraints of IEEE 802.15.4 networks, allowing seamless integration of resource-constrained devices into the internet. This protocol is essential for enabling IoT applications by providing efficient, standardized IP-based connectivity for sensors and actuators.
Acme Protocol
Acme Protocol is a standardized communication protocol used for automated certificate management, primarily for obtaining and renewing SSL/TLS certificates from certificate authorities (CAs). It enables servers and applications to automatically request, validate, and install certificates without manual intervention, streamlining the process of securing web services with HTTPS. The protocol is widely implemented by CAs and tools like Let's Encrypt to support the ACME (Automated Certificate Management Environment) standard.
ActivityPub
ActivityPub is a decentralized social networking protocol that enables different social platforms to communicate with each other, allowing users to interact across independent servers. It provides a standardized way for servers to exchange social activities like posts, likes, and follows, forming a federated network where no single entity controls the entire system. This protocol underpins many modern federated social networks, promoting interoperability and user autonomy.
ActivityPub
ActivityPub is a decentralized social networking protocol that enables different social media platforms to communicate with each other, allowing users to interact across servers. It defines a client-to-server API for creating, updating, and deleting content, and a server-to-server API for federated interactions, forming a federated social web. This protocol underpins federated social media networks like Mastodon, PeerTube, and Pixelfed, facilitating interoperability without central control.
ActivityPub
ActivityPub is an open, decentralized social networking protocol that enables servers to communicate and share social activities, such as posts, likes, and follows, across different platforms. It is a W3C standard that defines a client-to-server API for creating, updating, and deleting content, as well as a server-to-server API for federated interactions between independent servers. This allows users on different social media platforms to interact seamlessly, fostering interoperability in the fediverse.
AFP
AFP (Apple Filing Protocol) is a proprietary network protocol developed by Apple for file sharing over a network, primarily used with Apple's macOS and classic Mac OS operating systems. It enables users to access files and services on remote servers as if they were local, supporting features like file locking, Unicode filenames, and resource forks. While historically central to AppleTalk networks, it has been largely superseded by SMB (Server Message Block) in modern Apple environments.