Testing

WebSockets: Browser Support, Use Cases, Limitations

WebSockets work in Chrome 16+, Edge 12+, Firefox 11+, Safari 7+ on macOS, Safari 6+ on iOS, Opera 12.1+, and Samsung Internet 4+. Learn the API, use cases, and limits.

Author

Prince Dewani

May 1, 2026

WebSockets is an IETF protocol defined in RFC 6455 that opens a persistent two-way channel between a browser and a server over one TCP connection. It works in Chrome 16+, Edge 12+, Firefox 11+, Safari 7+ on macOS, Safari 6+ on iOS, Opera 12.1+, Samsung Internet 4+, and Internet Explorer 10 and 11, at near 99% global support.

This guide covers what WebSockets are, the browsers that support them, how they work, the use cases, and the limitations.

What are WebSockets?

WebSockets is a protocol that opens a single, persistent TCP connection and lets a browser and a server push messages to each other at any time without polling. The IETF standardized it as RFC 6455, and the WebSocket JavaScript interface is defined by the WHATWG HTML Living Standard.

Which browsers support WebSockets?

WebSockets ship in every modern browser, with global support near 99% across desktop and mobile. The protocol has been stable since the IETF published RFC 6455, so once a browser shipped it, the WebSocket interface has not broken across versions.

Loading browser compatibility data...

WebSockets compatibility in Chrome

Chrome supports WebSockets from Chrome 16 on Windows, macOS, Linux, ChromeOS, and Android. Chrome 4 to 15 had WebSockets disabled by default after a security bug in the early hybi-00 protocol draft. Chrome ships the wss:// secure variant on every supported version and tracks RFC 6455 in the upstream Chromium WebSocket stack.

WebSockets compatibility in Edge

Microsoft Edge supports WebSockets from Edge 12 on Windows, macOS, and Linux. Pre-Chromium EdgeHTML versions 12 to 18 used the Microsoft WebSocket stack inherited from Internet Explorer 10. Chromium-based Edge 79 and later track the upstream Chromium implementation, so behavior is consistent across every Edge release still in support.

WebSockets compatibility in Firefox

Firefox supports WebSockets from Firefox 11 on Windows, macOS, Linux, and Android. Firefox 6 to 10 used the prefixed MozWebSocket constructor while Mozilla iterated on the spec. Firefox 4 and 5 had WebSockets disabled by default after the same hybi-00 vulnerability that affected Chrome, and Firefox 2 to 3.6 did not support WebSockets at all.

WebSockets compatibility in Safari

Safari supports WebSockets from Safari 7 on macOS and from Safari 6 on iOS and iPadOS. Safari 5 to 6 on macOS used an older protocol draft that the rest of the web no longer accepts, so connections to RFC 6455 servers fail on those versions. Safari 4 and earlier did not support WebSockets, and Apple ships the wss:// secure variant on every supported Safari version.

WebSockets compatibility in Opera

Opera supports WebSockets from Opera 12.1 on Windows, macOS, and Linux. Opera 11 to 12.0 had WebSockets disabled by default after the hybi-00 protocol bug, and Opera 9 to 10 did not support WebSockets at all. Opera Mobile 12.1+ and Opera for Android both ship the protocol on phones and tablets, while Opera Mini does not expose the WebSocket interface in any version.

WebSockets compatibility in Samsung Internet

Samsung Internet supports WebSockets from Samsung Internet 4 on Galaxy phones and tablets. The browser tracks the Chromium WebSocket implementation, so any Samsung Internet release on a current Android device ships RFC 6455 with the wss:// secure variant on by default. Samsung Internet 1 to 3 did not support WebSockets.

WebSockets compatibility in Android Browser

Chrome for Android supports WebSockets from version 4.4 onward, which covers every Android device sold in the last decade. The legacy stock Android Browser based on WebView 3.x and earlier did not support WebSockets. Firefox for Android also supports WebSockets from Firefox 11 on phones and tablets.

WebSockets compatibility in Internet Explorer

Internet Explorer supports WebSockets from Internet Explorer 10 on Windows 7, Windows 8, and Windows Server 2012. Internet Explorer 6 to 9 did not support WebSockets at all. Microsoft has retired Internet Explorer 11, so move WebSocket workloads to Chromium-based Edge or Chrome for any new project.

Note

Note: WebSockets behave differently across browsers, proxies, and OS. Test them on real browsers and OS with TestMu AI. Try TestMu AI free!

How do WebSockets work?

WebSockets work by upgrading an HTTP connection to a long-lived TCP socket and then exchanging framed messages in both directions. The handshake and the message loop follow these steps:

  • Open a WebSocket from the browser: Call new WebSocket("wss://example.com/socket") with an optional list of subprotocols. The constructor returns immediately with the socket in the CONNECTING state.
  • Send the HTTP Upgrade request: The browser sends an HTTP/1.1 GET request that carries Upgrade: websocket, Connection: Upgrade, a random Sec-WebSocket-Key, and the protocol version Sec-WebSocket-Version: 13.
  • Receive the 101 Switching Protocols response: The server replies with a 101 status, a Sec-WebSocket-Accept header derived from the client key, and any subprotocol it picked from the request list.
  • Switch to the WebSocket frame protocol: Both sides now treat the same TCP socket as a stream of binary or text frames. Each frame carries an opcode, a payload length, an optional mask, and the payload bytes - no further HTTP headers.
  • Exchange messages in either direction: Either side can send a frame at any time. The browser fires the message event on receive, and the page calls socket.send to push data back. Ping and pong frames keep the connection alive across idle proxies.
  • Close the connection cleanly: Either side sends a close frame with a status code and an optional reason. The browser fires the close event with the same code, and the underlying TCP socket tears down.

The wss:// scheme runs the same protocol over TLS on port 443, which lets the connection traverse most corporate proxies and firewalls without extra configuration. Paste this snippet into the DevTools console of Chrome, Edge, Firefox, or Safari to confirm WebSocket support and watch a frame round-trip through a public echo server.

// Paste this into the DevTools console to confirm WebSocket support and open a test connection.
if ("WebSocket" in window) {
  console.log("WebSocket is supported in this browser.");

  const socket = new WebSocket("wss://echo.websocket.events");

  socket.addEventListener("open", () => {
    console.log("Connection opened, sending a test frame.");
    socket.send("hello from TestMu AI");
  });

  socket.addEventListener("message", (event) => {
    console.log("Echo received:", event.data);
    socket.close();
  });

  socket.addEventListener("close", (event) => {
    console.log("Connection closed with code", event.code);
  });

  socket.addEventListener("error", () => {
    console.log("WebSocket error: the echo server may be unreachable from this network.");
  });
} else {
  console.log("WebSocket is not supported in this browser.");
}

What are the use cases of WebSockets?

WebSockets fit any product that needs server-pushed updates faster than HTTP polling can deliver, with a roundtrip cost low enough for sub-second user feedback. The pattern that locks teams into WebSockets is bidirectional traffic, where both client and server initiate messages.

  • Chat and team messaging: Slack, Discord, and most live-chat widgets use WebSockets to push new messages, presence updates, typing indicators, and reactions. The persistent socket avoids the latency and battery cost of long polling on mobile clients.
  • Collaborative editors: Google Docs, Figma, Notion, and Linear stream document operations through WebSockets. The protocol carries operational transforms and conflict-free replicated data type updates with sub-100-millisecond latency between collaborators.
  • Live dashboards and trading: TradingView and most fintech dashboards stream price ticks, order book updates, and chart candles over WebSockets. Fan-out from one server to thousands of subscribers is a fixed cost per message instead of a per-poll cost.
  • Multiplayer games and live sports: Browser-based games and live scoreboards push state updates over WebSockets. The 30 to 60 frames-per-second update floor that competitive games need is only practical with a persistent connection.
  • IoT control panels: Home Assistant, AWS IoT, and Azure IoT Hub web consoles use WebSockets to send device state to the page and accept user commands back to the device without polling each sensor.
...

What are the limitations of WebSockets?

WebSockets buy real-time delivery at the cost of a long-lived connection that traditional HTTP infrastructure does not always handle cleanly. The painful failures cluster around proxies, load balancing, scaling, and HTTP/2 multiplexing.

  • Corporate proxies drop idle sockets: Many corporate forward proxies close TCP connections after 30 to 60 seconds of silence and never forward the WebSocket Upgrade. Send ping frames every 20 seconds and fall back to HTTP long polling for users behind strict firewalls.
  • Load balancers need sticky sessions: Round-robin load balancing breaks WebSockets because every frame after the handshake must reach the same backend. AWS Elastic Load Balancer, NGINX, and HAProxy all need session affinity or a dedicated WebSocket-aware setup.
  • No built-in reconnection: The browser does not retry a dropped connection, so the page must implement exponential backoff, queue replay, and last-event ID logic. Libraries like Socket.IO and Ably wrap this, but native WebSocket code has to write it.
  • Per-connection memory cost: A single idle WebSocket holds about 50 to 130 KB of server memory between TCP buffers, the WebSocket library object, and the application session. One million concurrent connections costs around 100 GB of RAM, so plan capacity early.
  • HTTP/2 and HTTP/3 multiplexing is patchy: RFC 8441 added a CONNECT-style WebSocket bootstrap over HTTP/2, but adoption is patchy and many CDNs still tunnel WebSockets over HTTP/1.1. The result is one TCP connection per WebSocket per origin instead of multiplexed streams.
  • Limited browser observability: Chrome DevTools shows WebSocket frames in the Network tab, but Firefox DevTools and Safari Web Inspector only surface the handshake. Production debugging usually relies on server-side logs and a Wireshark capture.

In my experience, the limitation that bites teams hardest is the proxy timeout. A real-time feature that works perfectly on home Wi-Fi falls silent on a hotel network because the proxy closes the socket after 60 seconds and the client never reconnects until the user refreshes the page. Wire ping frames and an exponential-backoff reconnect handler before you ship.

...

Citations

All WebSocket version numbers and platform notes in this guide come from these primary sources:

Author

Prince Dewani is a Community Contributor at TestMu AI, where he manages content strategies around software testing, QA, and test automation. He is certified in Selenium, Cypress, Playwright, Appium, Automation Testing, and KaneAI. Prince has also presented academic research at the international conference PBCON-01. He further specializes in on-page SEO, bridging marketing with core testing technologies. On LinkedIn, he is followed by 4,300+ QA engineers, developers, DevOps experts, tech leaders, and AI-focused practitioners in the global testing community.

Open in ChatGPT Icon

Open in ChatGPT

Open in Claude Icon

Open in Claude

Open in Perplexity Icon

Open in Perplexity

Open in Grok Icon

Open in Grok

Open in Gemini AI Icon

Open in Gemini AI

Copied to Clipboard!
...

3000+ Browsers. One Platform.

See exactly how your site performs everywhere.

Try it free
...

Write Tests in Plain English with KaneAI

Create, debug, and evolve tests using natural language.

Try for free

Frequently asked questions

Did you find this page helpful?

More Related Hubs

TestMu AI forEnterprise

Get access to solutions built on Enterprise
grade security, privacy, & compliance

  • Advanced access controls
  • Advanced data retention rules
  • Advanced Local Testing
  • Premium Support options
  • Early access to beta features
  • Private Slack Channel
  • Unlimited Manual Accessibility DevTools Tests