Skip to main content

Module session

Module session 

Source
Expand description

Per-connection proxy session β€” forwards streams between client and relay.

StructsΒ§

CachedShaper πŸ”’
What SessionShaper keeps behind its lock.
ControlFrameWalker πŸ”’
Where the message boundaries are on a control stream being forwarded verbatim.
ForwardCtx πŸ”’
Shared context for forwarding helpers, avoiding repeated parameter lists.
PeekedRecv πŸ”’
A receive stream with bytes already taken off it.
ProxySession
A proxy session that forwards traffic between a client and an upstream relay. One session is created per accepted client connection.
ProxySessionConfig
Configuration for a proxy session’s upstream connection.
SessionDraft πŸ”’
The draft this session frames with, and the one place every task reads it from.
SessionShaper πŸ”’
One session’s shaper, and the proxy profile it watches.
ShapedStream πŸ”’
Which stream a shaped release is happening on, for the events it owes.
SkipVerification πŸ”’
TLS certificate verifier that skips all verification (testing only).
StopWatcher πŸ”’
A destination-side STOP_SENDING watcher, hoisted once per forwarded stream and used as a fourth tokio::select! branch.
StreamState πŸ”’
The deferred-write state of one stream direction, plus the two facts every teardown helper needs about it.

EnumsΒ§

DraftPeek πŸ”’
What peek_draft made of a control stream’s opening bytes.
DraftSource πŸ”’
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.
HeaderStep πŸ”’
What one more header byte told ControlFrameWalker.
Source πŸ”’
What one poll of the source stream saw.
StreamRequest πŸ”’
What a data stream’s task does with a control-plane request.
UniStreamKind πŸ”’
What a unidirectional stream’s leading varint says the stream is.
UpstreamTransportType
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_unidirectional names, 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 ControlFrameWalker stops 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 ActionKind a returned Action will be reported as.
await_serialize_target πŸ”’
Hold this stream until target ends β€” 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::Shaped reports 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 drain to 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_datagram failure 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_streams reports 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_end and execute what it returns.
same_classes πŸ”’
Whether profile names exactly classes, in the same order.
serve_session_commands πŸ”’
Serve one session’s control-plane requests until the session ends.
setup_rank πŸ”’
Which DraftSource a SETUP peeked at on side carries.
stop_error πŸ”’
The one StopWatcher outcome 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 a DraftVersion, or None if 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Β§

StoppedFuture πŸ”’
A boxed SendStream::stopped() future.