pub enum Leg {
Client,
Upstream,
}Expand description
Which of the proxy’s two connections a call is about.
Not ProxySide, which this crate also
has and which names something else entirely. A leg is a connection:
the proxy holds exactly two, one to the client and one to the upstream
relay, and each has its own endpoint, its own socket, its own
certificate and its own transport parameters. A side is a direction of
travel over a leg, which is why ProxySide has four variants where
this has two — ClientToProxy and ProxyToClient are the two
directions of the client leg, ProxyToRelay and RelayToProxy the two
of the upstream leg.
The two are worth keeping straight because the compiler will not: both are
small Copy enums that a reader skims as which part of the proxy. The
test is what the thing being described belongs to. Anything QUIC settles
once for a whole connection — a window, an MTU, a congestion controller, a
socket — is a leg. Anything a single frame can be observed in or acted on —
an event, a shaping rule, a hook site — is a side.
Variants§
Client
The connection between a client and this proxy.
Upstream
The connection between this proxy and the upstream relay.