HTTP upgrade

The exchange in which a client asks, with an Upgrade header, to switch an HTTP connection to another protocol, and the server agrees with 101 Switching Protocols.

In more detail

It is how every WebSocket begins. The handshake is still an HTTP request, so it is the natural place to authenticate the caller and agree a subprotocol before messages flow.

Example

In Node.js the server emits upgrade with the request and the raw socket; after that you own the socket and must destroy it on shutdown.

Related terms

Taught in

References