Skip to content

isWebSocketCloseCodeSendable

isWebSocketCloseCodeSendable(code): boolean

Defined in: packages/format-websocket/src/close/websocket-close.ts:27

Whether code may be sent in a close frame (RFC 6455 §7.4, IANA WebSocket Close Code Number Registry): the defined codes 1000–1003 and 1007–1014, and the 3000–4999 ranges for libraries and applications.

1004 is reserved, and 1005, 1006 and 1015 exist only to report what happened locally — they must never appear on the wire.

number

boolean