Available on crate feature
gateway-api only.Expand description
TLS, TCP and UDP listeners: TLSRoutes (passthrough by SNI, or terminated with the listener’s certificates), TCPRoutes and UDPRoutes. A connection (or a UDP client’s datagrams) goes to one route — the one whose hostname best matches the SNI, else the oldest — and to a backend of its first rule by weight; bytes are relayed both ways.
Enums§
- Hello
- What the start of a TLS connection says.
Constants§
- UDP_
IDLE - How long a UDP client’s session lives without traffic.
Functions§
- client_
hello - Read the ClientHello at the start of
bytes. - pick_
endpoint - An endpoint of the route’s first rule with backends, by weight;
Nonewhen there is nothing to send to. - pick_
route - The route a connection goes to: the best hostname match for
sni(a route without hostnames matches anything, below any hostname match), ties to the oldest route, thennamespace/name. - serve_
tcp - A TCPRoute connection: straight to a backend.
- serve_
tls_ passthrough - A passthrough TLSRoute connection: read the ClientHello for its SNI, then replay it to the backend and relay the encrypted stream.
- serve_
tls_ terminate - A terminated TLSRoute connection: handshake with the listener’s certificates, then relay the plaintext.
- serve_
udp - A UDPRoute listener: each client address gets its own socket to a
backend (picked once), replies go back from the listener’s socket;
sessions end after
UDP_IDLEwithout traffic — or with the port: they’re in aJoinSetthis task owns, so dropping it (the port given up) aborts them and releases the socket at once.