subprotocol
The application-level message format agreed on top of a WebSocket during the handshake, named in the Sec-WebSocket-Protocol header.
In more detail
Naming and versioning it lets client and server check they speak the same message contract before any data flows. The client offers a list and the server picks one, or refuses the connection.
Related terms
- WebSocket — A protocol that turns an HTTP connection into a long-lived, two-way channel where client and server can each send messages at any time.
- 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.
Taught in
- WebSockets — Modern API Architecture: REST, GraphQL & gRPC