1.1.0 • Published 6 years ago

websocket-event-codes v1.1.0

Weekly downloads
117
License
MIT
Repository
github
Last release
6 years ago

Websocket Event Codes

Overview

A small Node module containing enumerated Websocket status codes. This module is library agnostic and has no dependencies.

Largely inspired by a similar module for HTTP status codes by prettymuchbryce

Installation

Via npm : npm install --save websocket-event-codes

Via yarn : yarn add websocket-event-codes

Event codes table

NameCodeDescription
NORMAL_CLOSURE1000The connection successfully completed whatever purpose for which it was created.
GOING_AWAY1001The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection.
PROTOCOL_ERROR1002The endpoint is terminating the connection due to a protocol error.
UNSUPPORTED_DATA1003he connection is being terminated because the endpoint received data of a type it cannot accept (for example, a text-only endpoint received binary data).
NO_STATUS_RECEIVED1005Reserved. Indicates that no status code was provided even though one was expected.
ABNORMAL_CLOSURE1006Reserved. Used to indicate that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected.
INVALID_FRAME_PAYLOAD_DATA1007The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message).
POLICY_VIOLATION1008The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable.
MESSAGE_TOO_BIG1009The endpoint is terminating the connection because a data frame was received that is too large.
MISSING_EXTENSION1010The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't.
INTERNAL_ERROR1011The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.
SERVICE_RESTART1012The server is terminating the connection because it is restarting.
TRY_AGAIN_LATER1013The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients.
BAD_GATEWAY1014The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code.
TLS_HANDSHAKE1015Reserved. Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified).