HTTP 101 Switching Protocols
HTTP 101 Switching Protocols is the server’s agreement to switch protocols on an HTTP/1.1 connection. The response identifies the agreed protocol in Upgrade. The bytes that follow the response headers belong to that protocol.
A WebSocket example
A client opens a WebSocket by sending the HTTP/1.1 upgrade request. With a valid 101 handshake, it can begin exchanging WebSocket frames. A browser can still reject the handshake if a required WebSocket response header is missing or invalid.
Where to look when the handshake fails
Try the same WebSocket client directly and through the proxy. A reverse proxy on the site side needs explicit support for forwarding the upgrade, because Connection and Upgrade apply to each HTTP/1.1 hop. When a forward proxy opens a CONNECT tunnel, its tunnel status is a separate response. Read the application handshake inside that tunnel.
Read the handshake in order
HTTP/1.1 200 Connection established
[client starts TLS through the tunnel]
HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
This abbreviated trace starts with an HTTP proxy opening the tunnel. After TLS is established inside it, the application sends the WebSocket handshake and receives the 101. A full browser check also validates the other fields required by WebSocket. If the CONNECT step returns an error, troubleshoot the proxy credentials or tunnel policy. If the handshake fails inside the tunnel, consult the WebSocket service and any reverse proxy serving it.
When the socket drops shortly after 101
Keep the connection open long enough to reproduce one disconnect, then match its timestamp in the application and gateway logs. A consistent drop after the same interval can point to an idle timeout. A drop during the first message calls for checking the client and server logs for protocol or application errors. The 101 is the evidence that the initial HTTP/1.1 upgrade step succeeded. It covers that step of the session.