WebSocket: persistent two-way web connections
WebSocket creates a long-lived two-way connection after an HTTP-based opening handshake. It suits chat, notifications and real-time data, but proxies, load balancers and network timeouts can still terminate the session.
How a persistent WebSocket connection works
WebSocket establishes a persistent bidirectional application channel after an HTTP-based opening handshake. The secure wss scheme protects the connection with TLS; intermediaries and idle timeouts can still terminate long-lived sessions.
How to diagnose a disconnect
Check the opening HTTP response and confirm the connection upgrades successfully, then observe whether it closes after a repeatable idle period. Reverse proxies, load balancers and firewalls often have timeouts that affect long-lived WebSocket sessions. If you first need to isolate basic TCP reachability, check the port with the 2ip port checker.
Where to look for an idle timeout
Technical reference: RFC 6455.