handshake
The opening exchange of messages in which two programs agree how they will communicate before real data flows.
In more detail
TCP, TLS and WebSocket each have one, and each adds a little latency before the first useful byte. Reusing connections, as keep-alive does, avoids repeating the handshake for every request.
Related terms
- TLS handshake — The opening exchange of a TLS connection, in which client and server agree on settings, check certificates and create shared keys.
- 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.
- TCP — The internet protocol that delivers data between programs reliably and in order, used by the web and most databases.
Taught in
- Native WebSockets: Bidirectional Real-Time Streams — Node.js Internals & Backend Services
- TLS & HTTPS Encryption: Certificates & SNI Contexts — Node.js Internals & Backend Services