WebSocket 1003 Unsupported Data vs 1013 Try Again Later
Both WebSocket 1003 (Unsupported Data) and 1013 (Try Again Later) belong to the WebSocket Close Codes category. 1003 indicates that an endpoint received a type of data it cannot accept. For example, a text-only endpoint received a binary message, or vice versa. Meanwhile, 1013 means that the server is terminating the connection due to a temporary condition, such as being overloaded. The client should reconnect after a back-off period.
Descrição
An endpoint received a type of data it cannot accept. For example, a text-only endpoint received a binary message, or vice versa.
Quando você o vê
The client sent a binary frame to a server that only handles text, or a text frame to a binary-only endpoint. The receiver does not know how to process this data type.
Como corrigir
Verify the message type (text vs binary) matches what the server expects. Update your client to send the correct opcode for the data format.
Descrição
The server is terminating the connection due to a temporary condition, such as being overloaded. The client should reconnect after a back-off period.
Quando você o vê
The server is temporarily overloaded or throttling connections. Unlike 1012, this does not indicate a restart — the server is running but cannot serve more clients right now.
Como corrigir
Reconnect using exponential backoff (start at 1 second, double each attempt). If persistent, investigate server capacity, scale horizontally, or reduce the number of concurrent connections.
Diferenças principais
WebSocket 1003: An endpoint received a type of data it cannot accept. For example, a text-only endpoint received a binary message, or vice versa.
WebSocket 1013: The server is terminating the connection due to a temporary condition, such as being overloaded. The client should reconnect after a back-off period.
You encounter 1003 when the client sent a binary frame to a server that only handles text, or a text frame to a binary-only endpoint. The receiver does not know how to process this data type.
You encounter 1013 when the server is temporarily overloaded or throttling connections. Unlike 1012, this does not indicate a restart — the server is running but cannot serve more clients right now.
Quando usar qual
For 1003 (Unsupported Data): Verify the message type (text vs binary) matches what the server expects. Update your client to send the correct opcode for the data format. For 1013 (Try Again Later): Reconnect using exponential backoff (start at 1 second, double each attempt). If persistent, investigate server capacity, scale horizontally, or reduce the number of concurrent connections.