Reference for all RFC 6455 WebSocket close status codes with descriptions, sender context, and a close frame builder.
16 codes
The connection completed its purpose successfully. Both endpoints agree to close.
RFC 6455 §7.4.1
An endpoint is "going away", such as a server going down or a browser having navigated away from a page.
RFC 6455 §7.4.1
An endpoint is terminating the connection due to a protocol error.
RFC 6455 §7.4.1
An endpoint received a type of data it cannot accept (e.g. a text-only endpoint received binary data).
RFC 6455 §7.4.1
Reserved. The specific meaning might be defined in the future.
RFC 6455 §7.4.1
A reserved value and MUST NOT be set as a status code in a Close control frame. Used internally to indicate no status code was present.
RFC 6455 §7.4.1
A reserved value and MUST NOT be set in a Close frame. Used to indicate an abnormal closure (no close frame was sent).
RFC 6455 §7.4.1
An endpoint received data within a message that was not consistent with the type of the message (e.g. non-UTF-8 data in a text message).
RFC 6455 §7.4.1
An endpoint received a message that violates its policy. A generic status code when 1003 and 1009 are not suitable.
RFC 6455 §7.4.1
An endpoint received a message that is too large for it to process.
RFC 6455 §7.4.1
The client expected the server to negotiate one or more extension, but the server did not.
RFC 6455 §7.4.1
The server encountered an unexpected condition that prevented it from fulfilling the request.
RFC 6455 §7.4.1
The server is restarting.
Draft extensions
The server is temporarily unable to handle the request due to a temporary overloading or maintenance of the server.
Draft extensions
The server received an invalid response from an upstream server (like a 502 HTTP status code).
Draft extensions
Reserved. Indicates TLS handshake failure. MUST NOT be set in a Close frame by an endpoint.
RFC 6455 §7.4.1
marduc812
2026