Skip to main content

default_tls_alpn

Function default_tls_alpn 

pub fn default_tls_alpn(protocol: &Protocol) -> Option<TlsAlpn>
Available on crate feature net only.
Expand description

Return Rama’s default TLS ALPN offer for an application protocol.

HTTP can negotiate HTTP/2 or HTTP/1.1. WebSocket defaults to HTTP/1.1 because HTTP/2 WebSocket support cannot be known until after ALPN negotiation; an explicit target HTTP version can opt into HTTP/2. Protocols without a standardized ALPN in Rama return None.