Skip to main content
1002

Protocol Error

Sent by: BothDo not retry

1002 Protocol Error indicates the endpoint is terminating the connection because the peer violated the WebSocket protocol. This is a hard error – the framing, opcodes, or handshake were invalid. Retrying the same connection without fixing the protocol issue will result in another 1002.

Description

1002 is sent when the received data violates the WebSocket spec (RFC 6455). Examples: malformed frame, unknown opcode, invalid control frame size, continuation frame without preceding fragmented message, or RSV bits set without negotiated extension. This typically indicates a bug in the WebSocket implementation on either side, not a transient network condition.

Common Causes

  • Malformed WebSocket frame received
  • Unknown or invalid opcode
  • Control frame exceeds 125 bytes
  • Reserved bits set without negotiated extension
  • Invalid UTF-8 in text frame

Code

1002

RFC

RFC 6455

Sent By

Both

Retry

No