101 Switching Protocols confirms that the server is changing the connection to the protocol named in the client's Upgrade header. It is how every WebSocket connection starts.
HTTP/1.1 101 Switching ProtocolsWhen servers send it
- A WebSocket handshake: the client sends Upgrade: websocket and Connection: Upgrade.
- An HTTP/1.1 connection upgrading to another protocol named in Upgrade.
How to handle it
- After 101 the connection speaks the new protocol; HTTP no longer applies to it.
- If you expect 101 but get 200 or 400, a proxy or load balancer is probably dropping the Upgrade and Connection headers.