Enumeration WebSocketCloseConst

A list of standard status codes used within WebSocket communication at connection close. Currently, not all are documented there, although all were listed, with some additional ones took from MDN.

Reference: MDN, RFC 6455.

Enumeration Members

AbnormalClosure: 1006

Reserved. Emitted when connection was closed abnormally, where status code was expected.

BadGateway: 1014
GoingAway: 1001

Emitted when endpoint is going away, e.g. on navigation or server failure.

InternalError: 1011
InvalidPayload: 1007

Indicates that server received a message with inconsistent data structure, e.g. a mixed UTF-8 encoded message that also includes the unrecognizable binary data.

MandatoryExtension: 1010
MessageTooBig: 1009

Indicates that received payload by the server is too large to be processed.

NoStatusReceived: 1005

Reserved. Indicates lack of the status/code, although it was expected.

Ok: 1000

Indicates that connection went successfully.

PolicyViolation: 1008

Indicates that sent message violates the server's policy. This code is meant to be a generic status code that can be used if there's no suitable more suitable status codes (like UnsupportedData or MessageTooBig). It could also be used if details about the policy should be hidden.

ProtocolError: 1002

Emitted once a protocol error occurs.

Reserved: 1004

Reserved. It currently has no meaning, but that might change in the future.

ServiceRestart: 1012
TryAgainLater: 1013

Emitted when server is terminating connection due to the temporarily condition, e.g. server overload.

UnsupportedData: 1003

Emitted once server received a kind of data it couldn't accept, e.g. binary message on endpoints supporting only UTF-8 encoded data.