Expand description
Per-connection proxy session β forwards streams between client and relay.
StructsΒ§
- Cached
Shaper π - What
SessionShaperkeeps behind its lock. - Control
Frame πWalker - Where the message boundaries are on a control stream being forwarded verbatim.
- Forward
Ctx π - Shared context for forwarding helpers, avoiding repeated parameter lists.
- Peeked
Recv π - A receive stream with bytes already taken off it.
- Proxy
Session - A proxy session that forwards traffic between a client and an upstream relay. One session is created per accepted client connection.
- Proxy
Session Config - Configuration for a proxy sessionβs upstream connection.
- Session
Draft π - The draft this session frames with, and the one place every task reads it from.
- Session
Shaper π - One sessionβs shaper, and the proxy profile it watches.
- Shaped
Stream π - Which stream a shaped release is happening on, for the events it owes.
- Skip
Verification π - TLS certificate verifier that skips all verification (testing only).
- Stop
Watcher π - A destination-side
STOP_SENDINGwatcher, hoisted once per forwarded stream and used as a fourthtokio::select!branch. - Stream
State π - The deferred-write state of one stream direction, plus the two facts every teardown helper needs about it.
EnumsΒ§
- Draft
Peek π - What
peek_draftmade of a control streamβs opening bytes. - Draft
Source π - Where a sessionβs draft came from, ranked by how much it is worth.
- Flow π
- Whether a stream direction may keep running after a helper returned.
- Header
Step π - What one more header byte told
ControlFrameWalker. - Source π
- What one poll of the source stream saw.
- Stream
Request π - What a data streamβs task does with a control-plane request.
- UniStream
Kind π - What a unidirectional streamβs leading varint says the stream is.
- Upstream
Transport Type - The transport type for upstream relay connections.
ConstantsΒ§
- CONTROL_
STREAM_ πTYPE - The unidirectional stream type that marks a control stream on the drafts
control_plane_is_unidirectionalnames, and the SETUP message type on the same drafts. They are one number, 0x2F00. - DETECT_
BUF_ πMAX - The most bytes a control stream is buffered for while its first message is peeked at.
- DRAFT_
SETTLE_ πWINDOW - How long a task that needs the sessionβs draft waits for the control stream to name one before running on the draft the session started with.
- MAX_
CONTROL_ πHEADER - The largest control-message header this crate can meet: an eight-byte type varint followed by an eight-byte length varint.
- MAX_
CONTROL_ πPAYLOAD - A declared control-message payload length above which
ControlFrameWalkerstops believing what it is reading. - MAX_
UNI_ πTYPE_ LEN - The most bytes a unidirectional streamβs type varint can occupy: nine, which is MoQTβs widest form from draft-17 (RFC 9000βs is eight).
FunctionsΒ§
- action_
kind π - The
ActionKinda returnedActionwill be reported as. - await_
serialize_ πtarget - Hold this stream until
targetends βStreamAction::SerializeAfter. - bidi_
streams_ πcarry_ requests - Whether this draft puts requests on bidirectional streams of their own, so that a bidirectional stream beyond the control stream is a stream this proxy has to forward.
- class_
label π - The label
ProxyEvent::Shapedreports a class under. - classify_
uni_ πstream - Read a unidirectional streamβs type varint and say what the stream is.
- close_
after_ πdraining - Give this sessionβs egress queues
drainto empty, then end it. - control_
event π - The observer event one parsed control frame produces.
- control_
plane_ πis_ unidirectional - Whether this draft carries control messages on a pair of unidirectional streams, making a bidirectional stream a request stream rather than the control stream.
- data_
stream_ πrequest - Interpret one request delivered to a data streamβs task.
- datagram_
is_ πstatus - Whether a decoded datagram header carries an Object Status.
- detect_
stream_ πtype - Determine the data stream type from the first varint on the stream.
- drain_
pending π - Flush anything the hook deferred, honouring its release times, as a race against session cancellation.
- egress_
side π - The egress side paired with an ingress side.
- emit_
parsed_ πframes - Feed bytes to the control parser and emit observer events for any completed frames.
- forward_
control_ πstream - Forward the control stream on the drafts whose control stream is the first client-initiated bidirectional stream β drafts 07 through 16.
- forward_
datagrams π - Forward datagrams from source to destination.
- forward_
mutated_ πframes - Feed bytes into the capturing control parser, then execute the hookβs decision on each completed frame.
- forward_
request_ πstreams - Forward bidirectional request streams, on the drafts where that is
what a bidirectional stream is β see
control_plane_is_unidirectional. - forward_
uni_ πstreams - Forward unidirectional streams from source to destination.
- is_
connection_ πlevel - Whether a
send_datagramfailure ends the session. - is_
mirrored_ πteardown - Whether a pipe error is an abnormal teardown the proxy already
mirrored and reported as
ProxyEvent::StreamReset. - new_
capturing_ πcontrol_ parser - Build a capturing control parser and count it.
- new_
control_ πparser - Build a non-capturing control parser and count it.
- note_
fetch_ πorder - File the Group Order a FETCH asked for, from the bytes leaving the proxy.
- note_
fetch_ πorders - File the Group Order every FETCH in this batch asked for.
- observe_
source π - Observe the source stream, whatever the egress queue is doing.
- paired_
ingress_ πside - The ingress side of the other direction of the same stream.
- peek_
draft π - Try to name the concrete draft by peeking at the first SETUP message on a control stream.
- pipe_
control π - Pipe one direction of a stream carrying MoQT control-message framing.
- pipe_
control_ πmutating - Parse-then-forward control stream pipe.
- pipe_
control_ πpassthrough - Forward-first control stream pipe.
- pipe_
data π - Pipe a unidirectional data stream.
- pipe_
data_ πframed - Forward a unidirectional data stream through the object framer.
- pipe_
data_ πpassthrough - Forward a unidirectional data stream without interpreting it.
- propagate_
reset π - Mirror a source-side read failure onto the destination stream.
- propagate_
stop π - Mirror a destination-side write failure onto the source stream.
- pump_
control_ πleg - Hand one control legβs requests to the stream that turned out to be that directionβs control stream.
- release_
due_ πunits - Write every unit whose release time has arrived, in order.
- report_
refused_ πframes - Report the control frames the decoder refused in one feed.
- report_
request_ πstream_ end - Report a request-stream pipe that ended badly, on the same terms
forward_uni_streamsreports one. - report_
shaping π - Emit whatever a shaped release decided, if anything.
- report_
unconfirmed π - Report whatever a teardown drain could not vouch for, once.
- request_
streams_ πbeside_ the_ control_ stream - The client-to-relay request-stream loop, for a draft whose control stream
is bidirectional and which has request streams as well β draft-16 alone.
See
bidi_streams_carry_requests. - run_
stream_ πend - Call
ProxyHook::on_stream_endand execute what it returns. - same_
classes π - Whether
profilenames exactlyclasses, in the same order. - serve_
session_ πcommands - Serve one sessionβs control-plane requests until the session ends.
- setup_
rank π - Which
DraftSourcea SETUP peeked at onsidecarries. - stop_
error π - The one
StopWatcheroutcome that ends a stream. - stream_
reset_ πcode_ defined - Whether the draft defines a stream-reset error code vocabulary.
- synthesized_
reset_ πcode - The application error code to reset a forwarded data stream with when
the source read failed for a reason that is not a peer
RESET_STREAM. - varint_
len π - Determine the encoded length of a QUIC varint from its first byte.
- version_
varint_ πto_ draft - Convert an on-wire MoQT version varint (
0xff000000 + draft) to aDraftVersion, orNoneif the value is malformed or unsupported. - write_
in_ πorder - Write bytes the hook was never shown, keeping wire order β on an unshaped stream.
- write_
with_ πinjections - Write one forwarded chunk with any held injections spliced in at
split.
Type AliasesΒ§
- Stopped
Future π - A boxed
SendStream::stopped()future.