Skip to main content

Module connect_udp

Module connect_udp 

Available on crate feature masque only.
Expand description

Proxying UDP in HTTP (RFC 9298).

Modules§

mitm
Relay a client’s own CONNECT-UDP session to its chosen proxy.

Structs§

ConnectUdpCapacityError
The tunnel’s payload limit fell below what its owner needs (ConnectUdpSocketConfig::with_min_payload); sent as the source of a DatagramError::Io.
ConnectUdpDestination
A resolved address a CONNECT-UDP tunnel would send to, for a ConnectUdpPolicy to judge.
ConnectUdpMetrics
Metrics of the tunnels of a ConnectUdpService built with them.
ConnectUdpRelay
The default relay of a ConnectUdpService: forwards UDP payloads between two connected sockets, such as a tunnel and its target socket, until either side ends. A payload too large for the other side is dropped alone; a clean or idle tunnel end is no failure.
ConnectUdpRequestMatcher
Recognises CONNECT-UDP requests for a proxy template and extracts their target.
ConnectUdpRule
One rule of ConnectUdpRules: it matches when each criterion it sets matches.
ConnectUdpRules
An ordered list of ConnectUdpRules: the first matching rule decides, and a destination no rule matches gets the default action.
ConnectUdpSender
Send handle of a ConnectUdpSocket, with its own readiness registration.
ConnectUdpService
A CONNECT-UDP proxy (RFC 9298) for every HTTP version.
ConnectUdpSocket
A DatagramSocket carrying UDP payloads through a CONNECT-UDP tunnel (RFC 9298).
ConnectUdpSocketConfig
Limits of a ConnectUdpSocket.
ConnectUdpStats
What a CONNECT-UDP tunnel received, forwarded and dropped, for one tunnel.
ConnectUdpTarget
The UDP target of a CONNECT-UDP tunnel (RFC 9298 §3).
ConnectUdpTargetHint
The target suggested by a proxy URI and the evidence behind it. Only a known mapping identifies what the client requested. An inferred value is suitable for diagnostics and must not authorize traffic.
DestinationScopePolicy
The default ConnectUdpPolicy: refuses every non-global address and the proxy itself.
HttpConnectUdpProxyConnector
A datagram proxy connector for MASQUE (RFC 9298): a CONNECT-UDP tunnel to the target of a request on a ProxyRoute, opened over the connector C towards that proxy.
HttpConnectUdpProxyConnectorLayer
A Layer producing HttpConnectUdpProxyConnectors over the connector towards proxies.
InferConnectUdpTarget
Self::default() recognizes the RFC 9298 well-known template. Use Self::new when the proxy publishes a different template. Try a known template first, then inspect query names and adjacent path segments. Conflicting candidates and duplicate named parameters yield no hint. A path-only hostname must contain a dot or colon. Percent decoding works on individual components, so encoded separators cannot create segments.
TunnelBudget
What each CONNECT-UDP tunnel of a proxy may move.

Enums§

ConnectUdpAction
What a matching ConnectUdpRule decides.
ConnectUdpClose
Why a ConnectUdpSocket stopped.
ConnectUdpRequestError
Why a CONNECT-UDP request could not be built or accepted.
ConnectUdpTargetError
Why target_host / target_port values do not form a ConnectUdpTarget.
ContextPayloadError
Why an HTTP Datagram payload is not a valid CONNECT-UDP payload.
TargetEvidence
How the target was recovered, in increasing order of confidence.

Constants§

MAX_UDP_PAYLOAD
Largest UDP payload a context-0 datagram may carry (RFC 9298 §5).
OUTER_IDLE_TIMEOUT
Idle timeout for a QUIC connection to a MASQUE proxy that carries tunnels: longer than a tunnel’s own idle policy (two minutes, RFC 9298 §3.1), so that policy decides when a quiet tunnel ends. Configure it on both sides of that connection.
OUTER_INITIAL_MTU
Initial MTU for a QUIC connection to a MASQUE proxy that carries tunnels as HTTP/3 datagrams: an inner QUIC packet needs 1200 bytes plus the outer packet’s overhead, which QUIC’s default of 1200 leaves no room for. Configure it on both sides of that connection.

Traits§

ConnectUdpPolicy
Decides which resolved addresses a CONNECT-UDP proxy may open tunnels to.
ConnectUdpTargetParser
Extracts optional target metadata independently of routing an accepted tunnel. Closures can supply the URI conventions of a particular proxy.

Functions§

connect_udp_request
Build the CONNECT-UDP request opening a tunnel to target through proxy.
decode_context_payload
Split an HTTP Datagram payload into its Context ID and the rest (RFC 9298 §5).
encode_udp_payload
Append a context-0 HTTP Datagram payload carrying payload.
session_config
The SessionConfig a CONNECT-UDP tunnel’s HttpDatagramSession needs.
validate_connect_udp_response
Check a proxy’s answer to a CONNECT-UDP request (RFC 9298 §3.3, §3.5).