WebSocket Status Codes

A protocol providing full-duplex communication channels over a single TCP connection. Close codes indicate why a connection was terminated.

View Specification →

1000-1015 WebSocket Close Codes

IANA-registered WebSocket close status codes (RFC 6455).

1000
Normal Closure

The connection has been closed cleanly, meaning the purpose for which it was established has been fulfilled. Both endpoints agree …

1001
Going Away

An endpoint is going away, such as a server shutting down or a browser navigating away from the page. The …

1002
Protocol Error

An endpoint is terminating the connection because it received data that violates the WebSocket protocol specification.

1003
Unsupported Data

An endpoint received a type of data it cannot accept. For example, a text-only endpoint received a binary message, or …

1005
No Status Received

A reserved value that indicates no status code was present in the Close frame. This code must not be set …

1006
Abnormal Closure

A reserved value indicating the connection was closed abnormally without a Close frame being sent. This code must not be …

1007
Invalid Payload Data

An endpoint received a message with payload data that is inconsistent with the message type. For example, a text message …

1008
Policy Violation

An endpoint is terminating the connection because it received a message that violates its policy. This is a generic code …

1009
Message Too Big

An endpoint is terminating the connection because it received a message that is too large for it to process.

1010
Mandatory Extension

The client is terminating the connection because the server did not negotiate one or more expected extensions in the handshake …

1011
Internal Error

The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.

1012
Service Restart

The server is terminating the connection because it is restarting. The client should reconnect after a brief delay.

1013
Try Again Later

The server is terminating the connection due to a temporary condition, such as being overloaded. The client should reconnect after …

1014
Bad Gateway

The server acting as a gateway or proxy received an invalid response from an upstream server it accessed while attempting …

1015
TLS Handshake Failure

A reserved value indicating the connection was closed because the TLS handshake failed. This code must not be set by …