WebSocket

WebSocket 1005 No Status Received vs 1014 Bad Gateway

Both WebSocket 1005 (No Status Received) and 1014 (Bad Gateway) belong to the WebSocket Close Codes category. 1005 indicates that a reserved value that indicates no status code was present in the Close frame. This code must not be set by an endpoint when sending a Close frame. 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.

説明

A reserved value that indicates no status code was present in the Close frame. This code must not be set by an endpoint when sending a Close frame.

このコードが表示される場合

The peer closed the connection with a Close frame that contained no status code payload. Your WebSocket library surfaces 1005 as a sentinel to indicate the absence of a code.

解決方法

This is an internal indicator, not a wire protocol value. If you see it frequently, the remote peer may have a bug where it sends empty Close frames — check the peer's implementation.

説明

The server acting as a gateway or proxy received an invalid response from an upstream server it accessed while attempting to fulfill the request.

このコードが表示される場合

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.

解決方法

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.

主な違い

1.

WebSocket 1005: A reserved value that indicates no status code was present in the Close frame. This code must not be set by an endpoint when sending a Close frame.

2.

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.

3.

You encounter 1005 when the peer closed the connection with a Close frame that contained no status code payload. Your WebSocket library surfaces 1005 as a sentinel to indicate the absence of a code.

4.

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.

どちらをいつ使うか

For 1005 (No Status Received): This is an internal indicator, not a wire protocol value. If you see it frequently, the remote peer may have a bug where it sends empty Close frames — check the peer's implementation. 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.

詳しく見る