Skip to content

encodeWebSocketClosePayload

encodeWebSocketClosePayload(close): Uint8Array<ArrayBuffer>

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

Encodes a close payload: the status code, then the reason as UTF-8.

WebSocketClose

code null sends an empty payload, and then reason must be empty too.

Uint8Array<ArrayBuffer>

When the code may not be sent, a reason comes without a code, or the reason exceeds 123 UTF-8 bytes.