Tool

WebSocket Close Code Lookup

Look up WebSocket close codes, their meanings, and recovery actions for production debugging. Filter by category or search by code, name, or symptom.

WebSocket close codes are 16-bit unsigned integers sent in close frames. Codes 1000–1015 are standard protocol codes. Codes 3000–3999 are for applications. Codes 4000–4999 are for private services.

The most common production issue is code 1006 (Abnormal Closure), which typically means a network issue, timeout, or load balancer killed the connection.

Showing 20 of 20 codes

CodeNameCopy
1000NormalNormal Closure
1001NormalGoing Away
1002ProtocolProtocol Error
1003ProtocolUnsupported Data
1005ErrorNo Status Received
1006ErrorAbnormal Closure
1007ProtocolInvalid Frame Payload Data
1008ErrorPolicy Violation
1009ProtocolMessage Too Big
1010ProtocolMissing Extension
1011ErrorInternal Error
1012NormalService Restart
1013ErrorTry Again Later
1014ErrorBad Gateway
1015ErrorTLS Handshake Failed
3000ApplicationApplication Reserved Start
4000ApplicationApplication Reserved Start (Service)
4001ApplicationAuth Expired
4002ApplicationRate Limited
4003ApplicationUnauthorized

Frequently asked questions

What is WebSocket close code 1006?
Code 1006 (Abnormal Closure) means the connection closed without sending a close frame. This is the most common production issue. It typically indicates a network problem, proxy timeout, load balancer killing idle connections, or a server crash. Implement reconnection with exponential backoff + jitter.
How do I fix WebSocket close code 1006?
Fix 1006 by: (1) implementing automatic reconnection with backoff, (2) sending periodic heartbeat/ping frames to keep the connection alive, (3) checking load balancer timeout settings, (4) adding WebSocket health monitoring with alerts, and (5) verifying firewall/proxy settings don't drop long-lived connections.
What is the difference between close code 1000 and 1001?
Code 1000 (Normal Closure) means both sides agreed to close the connection cleanly — no action needed. Code 1001 (Going Away) means the server is shutting down or the browser navigated away. For 1001, reconnect after a short delay and check if the server is undergoing maintenance.
Which WebSocket close codes require reconnection?
Codes requiring reconnection: 1001 (Going Away), 1005 (No Status), 1006 (Abnormal Closure), 1011 (Internal Error), 1012 (Service Restart), 1013 (Try Again Later), 1014 (Bad Gateway), and any application-range codes (4000-4999) indicating auth expiry or rate limiting.