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.
| Code | Name | Description |
|---|---|---|
| 1000 | Normal Closure | The connection completed its purpose. |
| 1001 | Going Away | Server or browser is going away (tab closed, server restart). |
| 1002 | Protocol Error | Endpoint received a malformed frame. |
| 1003 | Unsupported Data | Endpoint received data type it cannot handle (e.g., text-only endpoint got binary). |
| 1004 | Reserved | Reserved for future use. |
| 1005 | No Status Received | Expected a status code but none was received. |
| 1006 | Abnormal Closure | Connection was closed abnormally (no close frame sent). |
| 1007 | Invalid Frame Payload Data | Data in a message is not consistent with its type. |
| 1008 | Policy Violation | Endpoint received a message that violates its policy. |
| 1009 | Message Too Big | Message is too large to process. |
| 1010 | Mandatory Extension | Client expected the server to negotiate an extension. |
| 1011 | Internal Error | Server encountered an unexpected condition. |
| 1012 | Service Restart | Server is restarting. |
| 1013 | Try Again Later | Server is temporarily unable to handle the request. |
| 1015 | TLS Handshake | TLS handshake failure (not sent in frames). |
marduc812
2026