Skip to main content

Module session

Module session 

Source
Available on crate feature std only.
Expand description

Client-First Transport Session

PhantomSession is the user-facing client session: connect_with_transport returns instantly and spawns a background task that drives the hybrid post-quantum handshake and then the data pump, with send() calls queued in-memory until the handshake completes. It is the transport-level API that sits directly above a SessionTransport byte-pipe (PhantomUDP / TCP / WebSocket / WASI / Embedded / MimicTls) and below any application protocol an embedder layers on top of send() / recv().

This file also carries the shared client/server data pump (run_data_pump) and every per-packet build/parse helper (send_app_data, handle_packet, the keep-alive / cover / window-update / path-validation senders), so any change to encrypt/decrypt, framing, or stream routing happens here, in one place, for both sides.

Re-exports§

pub use crate::transport::session_transport::FramePhase;
pub use crate::transport::session_transport::SessionTransport;

Structs§

PhantomSession
Client-first session — instant construction, non-blocking send().
ResumptionHint
0-RTT resumption material extracted from a completed session.
TrafficShapingConfig
Anti-fingerprint traffic-shaping configuration (WIRE v6, direction #4). Set on an established session via PhantomSession::set_traffic_shaping. All shaping is opt-in — the default (and the field defaults here) is no shaping, so a session pays nothing unless an embedder enables it.

Enums§

ConnectionState
Connection state for PhantomSession.
SessionCommand
Commands for the background session task

Functions§

connect_pinned
connect_pinned_mimicmimicry and non-WebAssembly
Connect to a pinned server over the TLS-over-TCP active-mimicry transport (mimicry feature) — the flow looks like an ordinary HTTPS handshake to an on-path observer, while the real authentication / confidentiality remains the inner Phantom post-quantum session.
connect_pinned_with_resumption
Connect to a pinned server with a 0-RTT resumption attempt — the resumption-aware analogue of connect_pinned.