WebSocket failed JavaScript Origin: On your device Last updated 9 Oct 2026

WebSocket connection to 'wss://x' failed

The browser couldn’t open (or keep) a WebSocket connection.

Exact message you may see WebSocket connection toWebSocket is closed before the connection is establishedfailed: Error during WebSocket handshake
Seen on: JavaScript

Meaning

Proxies that don’t forward the Upgrade header, ws:// from an HTTPS page, wrong paths, and load balancer idle timeouts are typical.

Common causes

  • Reverse proxy not forwarding Upgrade/Connection headers
  • ws:// used on an HTTPS page (must be wss://)
  • Wrong URL/path or server down
  • Idle timeout closing the connection

⚡ Quick fix

  1. Configure proxy upgrade headers
  2. Use wss:// on HTTPS pages
  3. Send ping/heartbeats
  4. Check the server logs for the handshake

Detailed fix by platform

Nginx

  1. nginx
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";

How to diagnose

  1. Handshake — Status of the upgrade request (101 expected)?
  2. Proxy — Upgrade headers forwarded?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

0x80070035 — 0x80070035: The network path was not found (System error 53) (Windows)0x800700350x80072EE7 — Error 0x80072EE7 (Windows Update / Microsoft Store: server name could not be resolved) (Windows)0x80072EE70x8024402C — Windows Update error 0x8024402C (cannot connect to update server) (Windows)0x8024402C14 UNAVAILABLE — gRPC Error: 14 UNAVAILABLE: No connection established / failed to connect to all addresses (API)14 UNAVAILABLE511 — HTTP 511 Network Authentication Required (HTTP)511AbortError — AbortError: The user aborted a request. / signal is aborted without reason (JavaScript)AbortErrorauth/network-request-failed — Firebase Auth: auth/network-request-failed — A network AuthError (such as timeout, interrupted connection or unreachable host) has occurred (Authentication)auth/network-request-…captive portal — Browser: This network requires you to sign in — captive portal (hotel, airport, café Wi-Fi) blocking HTTPS sites (Browser)captive portalWebSocket…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.