websocket
WebSocket Close Codes
Numeric codes sent in a WebSocket Close frame to indicate why a connection is being terminated, as defined in RFC 6455 section 7.4 and the IANA WebSocket Close Code registry.
16 codes
· All codes 16 codes
- 1000 Normal Closure The connection closed successfully and the purpose for which it was established has been fulfilled.
- 1001 Going Away The endpoint is going away, such as a server shutting down or a browser navigating away from the page.
- 1002 Protocol Error The endpoint is terminating the connection because it received a message that violated the WebSocket protocol.
- 1003 Unsupported Data The endpoint is terminating the connection because it received data of a type it cannot accept (e.g. a text-only endpoint receiving binary data).
- 1004 Reserved Reserved for future use. This close code must not be set as a status code in a Close control frame by an endpoint.
- 1005 No Status Received A reserved value indicating that no status code was present in a Close frame; it must not be sent in a Close frame by an endpoint.
- 1006 Abnormal Closure A reserved value indicating that the connection was closed abnormally (e.g. without a Close frame being sent); it must not be sent in a Close frame by an endpoint.
- 1007 Invalid Frame Payload Data The endpoint is terminating the connection because it received data that was not consistent with the expected type (e.g. non-UTF-8 data in a text message).
- 1008 Policy Violation The endpoint is terminating the connection because it received a message that violates its policy; this is a generic code when codes 1003 and 1009 are not suitable.
- 1009 Message Too Big The endpoint is terminating the connection because a received message is too large to process.
- 1010 Mandatory Extension The client is terminating the connection because the server failed to negotiate one or more extensions that the client required.
- 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; clients may reconnect and should use exponential back-off.
- 1013 Try Again Later The server is terminating the connection due to a temporary condition; clients may reconnect after a delay.
- 1014 Bad Gateway The server, acting as a gateway or proxy, received an invalid response from an upstream server while handling the WebSocket handshake.
- 1015 TLS Handshake A reserved value indicating that the connection was closed because a TLS handshake failure occurred; it must not be sent in a Close frame by an endpoint.