Skip to content

decodeWebSocketClosePayload

decodeWebSocketClosePayload(payload): WebSocketFrameError | WebSocketClose

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

Decodes a close payload received from the peer.

Uint8Array

WebSocketFrameError | WebSocketClose

The close, or a WebSocketFrameError — 1002 for a one-byte payload or a code that may not be sent, 1007 for a reason that is not UTF-8.