#[non_exhaustive]pub struct ProxyHeader<'a> {
pub version: u8,
pub command: ProxyCommand,
pub transport: ProxyTransport,
pub source: Option<ProxyAddress<'a>>,
pub destination: Option<ProxyAddress<'a>>,
pub tlvs: Tlvs<'a>,
/* private fields */
}proxy only.Expand description
A parsed PROXY header, borrowing from the bytes it was parsed from.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.version: u81 or 2.
command: ProxyCommandProxy, or Local (a connection made by the proxy itself, such as a
health check: keep the socket’s own addresses).
transport: ProxyTransportThe transport of the proxied connection.
source: Option<ProxyAddress<'a>>The real client; None for LOCAL, v1 UNKNOWN, and v2 UNSPEC.
destination: Option<ProxyAddress<'a>>The address the client connected to; None as for source.
tlvs: Tlvs<'a>The v2 TLVs (empty for v1); NOOP entries are skipped.
Implementations§
Source§impl<'a> ProxyHeader<'a>
impl<'a> ProxyHeader<'a>
Sourcepub fn alpn(&self) -> Option<&'a [u8]>
pub fn alpn(&self) -> Option<&'a [u8]>
The ALPN protocol the proxy negotiated with the client (TLV 0x01).
The authority (host name) the client asked for (TLV 0x02), if UTF-8.
Sourcepub fn unique_id(&self) -> Option<&'a [u8]>
pub fn unique_id(&self) -> Option<&'a [u8]>
The proxy’s unique connection id (TLV 0x05, at most 128 bytes).
Sourcepub fn network_namespace(&self) -> Option<&'a [u8]>
pub fn network_namespace(&self) -> Option<&'a [u8]>
The network namespace (TLV 0x30).
Sourcepub fn crc_checked(&self) -> bool
pub fn crc_checked(&self) -> bool
Whether a CRC32C TLV was present and matched.
Sourcepub fn to_facts(&self) -> ProxyFacts
pub fn to_facts(&self) -> ProxyFacts
The facts net-io keeps after the header’s bytes are gone (fixed arrays; a value longer than its array is left out).