Network

WebSocket Frame Decoder

Decode a WebSocket frame from hex bytes (RFC 6455). Parses FIN, RSV bits, opcode, MASK bit, payload length, masking key, and payload. Includes opcode and close code reference tables.

Opcode Reference
0x0Continuation
0x1Text
0x2Binary
0x3Reserved (3)
0x4Reserved (4)
0x5Reserved (5)
0x6Reserved (6)
0x7Reserved (7)
0x8Close
0x9Ping
0xAPong
0xBReserved (B)
Close Codes
CodeNameDescription
1000Normal ClosureThe connection completed its purpose.
1001Going AwayServer or browser is going away (tab closed, server restart).
1002Protocol ErrorEndpoint received a malformed frame.
1003Unsupported DataEndpoint received data type it cannot handle (e.g., text-only endpoint got binary).
1004ReservedReserved for future use.
1005No Status ReceivedExpected a status code but none was received.
1006Abnormal ClosureConnection was closed abnormally (no close frame sent).
1007Invalid Frame Payload DataData in a message is not consistent with its type.
1008Policy ViolationEndpoint received a message that violates its policy.
1009Message Too BigMessage is too large to process.
1010Mandatory ExtensionClient expected the server to negotiate an extension.
1011Internal ErrorServer encountered an unexpected condition.
1012Service RestartServer is restarting.
1013Try Again LaterServer is temporarily unable to handle the request.
1015TLS HandshakeTLS handshake failure (not sent in frames).
Share

marduc812

2026