WebSocket

WebSocket 1005 No Status Received vs 1010 Mandatory Extension

Both WebSocket 1005 (No Status Received) and 1010 (Mandatory Extension) 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, 1010 means that the client is terminating the connection because the server did not negotiate one or more expected extensions in the handshake response.

Açıklama

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.

Gördüğünüzde

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.

Nasıl Düzeltilir

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.

Açıklama

The client is terminating the connection because the server did not negotiate one or more expected extensions in the handshake response.

Gördüğünüzde

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.

Nasıl Düzeltilir

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.

Temel Farklar

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 1010: The client is terminating the connection because the server did not negotiate one or more expected extensions in the handshake response.

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 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.

Hangisini Ne Zaman Kullanmalı

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 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.

Daha Fazla Öğren