HTTP 101 Switching Protocols indicates the server understands and agrees to the client's request to change the application protocol via the Upgrade header. This is commonly seen during WebSocket handshakes where the connection upgrades from HTTP to the WebSocket protocol.
The client requested a WebSocket connection via the Upgrade: websocket header and the server accepted the protocol switch.
The client requested an upgrade to HTTP/2 using the Upgrade header in an HTTP/1.1 request.
If upgrading to WebSocket, confirm the server responds with Upgrade: websocket and Connection: Upgrade headers.
curl -v -H 'Upgrade: websocket' -H 'Connection: Upgrade' -H 'Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==' -H 'Sec-WebSocket-Version: 13' https://example.com/ws
Ensure any reverse proxy (Nginx, Cloudflare) supports WebSocket pass-through. Proxies that do not forward Upgrade headers will break the handshake.