WebSocket 1010 Mandatory Extension vs 1014 Bad Gateway
Both WebSocket 1010 (Mandatory Extension) and 1014 (Bad Gateway) belong to the WebSocket Close Codes category. 1010 indicates that the client is terminating the connection because the server did not negotiate one or more expected extensions in the handshake response. Meanwhile, 1014 means that the server acting as a gateway or proxy received an invalid response from an upstream server it accessed while attempting to fulfill the request.
Descrição
The client is terminating the connection because the server did not negotiate one or more expected extensions in the handshake response.
Quando você o vê
The client requested a required WebSocket extension (e.g., permessage-deflate compression) during the handshake, but the server did not include it in its response.
Como corrigir
Enable the required extension on the server, or update the client to make the extension optional. Check the Sec-WebSocket-Extensions header in the handshake response.
Descrição
The server acting as a gateway or proxy received an invalid response from an upstream server it accessed while attempting to fulfill the request.
Quando você o vê
A reverse proxy or API gateway tried to establish a WebSocket connection to a backend server but received an invalid or no response. The upstream server may be down or misconfigured.
Como corrigir
Check the health of the upstream/backend WebSocket server. Verify the proxy configuration routes WebSocket upgrade requests correctly and that the backend is listening on the expected port.
Diferenças principais
WebSocket 1010: The client is terminating the connection because the server did not negotiate one or more expected extensions in the handshake response.
WebSocket 1014: The server acting as a gateway or proxy received an invalid response from an upstream server it accessed while attempting to fulfill the request.
You encounter 1010 when the client requested a required WebSocket extension (e.g., permessage-deflate compression) during the handshake, but the server did not include it in its response.
You encounter 1014 when a reverse proxy or API gateway tried to establish a WebSocket connection to a backend server but received an invalid or no response. The upstream server may be down or misconfigured.
Quando usar qual
For 1010 (Mandatory Extension): Enable the required extension on the server, or update the client to make the extension optional. Check the Sec-WebSocket-Extensions header in the handshake response. For 1014 (Bad Gateway): Check the health of the upstream/backend WebSocket server. Verify the proxy configuration routes WebSocket upgrade requests correctly and that the backend is listening on the expected port.