pub struct AuthenticatedSession {
pub connection: Connection,
pub send: SendStream,
pub recv: RecvStream,
pub session_id: SessionId,
pub transport: SessionTransport,
/* private fields */
}Expand description
A fully-authenticated Control stream on top of a live connection —
either QUIC (krot/1) or TLS-over-TCP (krot-tcp/1, §16.1).
Fields§
§connection: Connection§send: SendStream§recv: RecvStream§session_id: SessionId§transport: SessionTransportImplementations§
Source§impl AuthenticatedSession
impl AuthenticatedSession
Sourcepub async fn connect(
pin: &ServerPin,
identity: &Identity,
) -> Result<Self, ClientError>
pub async fn connect( pin: &ServerPin, identity: &Identity, ) -> Result<Self, ClientError>
Connect to pin with §16.1 auto-fallback: try QUIC first,
and on any transport-level failure retry once against the same
host over krot-tcp/1. On success runs the Ed25519
challenge-response and returns the resulting session with its
Control stream ready for tunnel frames.
Sourcepub async fn connect_quic(
pin: &ServerPin,
identity: &Identity,
) -> Result<Self, ClientError>
pub async fn connect_quic( pin: &ServerPin, identity: &Identity, ) -> Result<Self, ClientError>
Force the QUIC transport. Skips the §16.1.5 fallback; useful for tests that want to isolate one code path.
Sourcepub async fn connect_tcp(
pin: &ServerPin,
identity: &Identity,
) -> Result<Self, ClientError>
pub async fn connect_tcp( pin: &ServerPin, identity: &Identity, ) -> Result<Self, ClientError>
Force the TCP fallback transport. Skips the §16.1.5 fallback preference; useful for tests and for operators who KNOW their network blocks UDP.
Sourcepub async fn list_peers(&mut self) -> Result<Vec<String>, ClientError>
pub async fn list_peers(&mut self) -> Result<Vec<String>, ClientError>
§16.3.5: ask the server for the federated peer relays this
identity is authorized to publish on. The response is the
intersection of the server’s static peer list (§16.3.2) and
this identity’s federation= allowlist (§16.3.1).
Callers use the returned apex list to open additional sessions (one per peer) and re-publish the same tunnel on each — the operator gets one URL per relay.