Module handshake
Available on crate features
http and std only.Expand description
Upgrade-token handshakes for protocols that use the Capsule Protocol (RFC 9297 §3.2).
HTTP/1.1 upgrades with Upgrade + Connection: upgrade and succeeds with 101; HTTP/2 and
HTTP/3 use Extended CONNECT (RFC 8441, RFC 9220) and succeed with any 2xx. HTTP/1.0 cannot
upgrade (RFC 9110 §7.8). These helpers keep that version mapping in one place.
Received messages are checked under a ViolationPolicy. Reject treats every field
RFC 9297 §3.2 forbids as malformed. Ignore only rejects fields that would frame request
content ahead of the capsules (a non-zero Content-Length, any Transfer-Encoding); on a
101 or a 2xx CONNECT response they never frame the tunnel and are left alone.
Enums§
- Capsule
Handshake Error - A handshake that cannot start or accept the Capsule Protocol.
Functions§
- capsule_
response - Build the response accepting a Capsule Protocol handshake for
protocolonversion. - capsule_
response_ status - The status accepting a Capsule Protocol handshake on
version. - prepare_
capsule_ request - Turn
requestinto a Capsule Protocol handshake forprotocolon its HTTP version, advertisingCapsule-Protocol: ?1. The request must not carry content. - validate_
capsule_ request - Validate a received Capsule Protocol handshake request and return its upgrade token.
- validate_
capsule_ response - Validate the response to a Capsule Protocol handshake for
protocolsent onversion.