pub fn encode_connect_request(
request: &ConnectRequest<'_>,
) -> Result<Vec<u8>, ConnectError>Expand description
Serialize a CONNECT request head.
Wire shape:
CONNECT host:port HTTP/1.1\r\n
Host: host:port\r\n
[Proxy-Authorization: ...\r\n]
[proxy-only headers...]
\r\nยงErrors
Returns ConnectError when a header name/value is unsafe, when a
reserved header (Host) would override the generated authority, when
two Proxy-Authorization values would be emitted, or when the
serialized head exceeds max_head_bytes. No credentials or header
bytes are echoed in errors.