Skip to main content

Module relayed

Module relayed 

Source
Expand description

Relayed-transport method (TURN-like) — the last resort, tier 6.

This tier is sharply distinct from the tier-5 hole-punch (super::hole_punch):

TierMethodRelay’s roleRelay bandwidth
5HolePunchMethodsignaling only — brokers a candidate exchange, then the DATA path is peer-to-peer directminimal (a few coordination messages)
6RelayedTransportMethod (this)carries ALL data — every byte of the peer connection is proxied through the relay (RLY-002 relay_message)highest — the relay proxies the whole stream

Because tier 6 costs the relay the most bandwidth, it is tried only after the tier-5 hole punch fails: prefer brokering an introduction (hole punch) over proxying the stream (TURN). The crate::strategy enforces this via super::TraversalKind::rank (HolePunch=4 < Relayed=5).

After the relay opens the tunnel, the resulting byte stream is still wrapped in the same mTLS (peer_id = SHA-256(SPKI)) as every other tier — the relay proxies ciphertext it cannot read.

The relay data-plane is abstracted behind RelayedTransport so the method is unit-tested with a mock (no real relay). The production impl opens an RLY-002 forwarding channel to the target peer through the relay WebSocket.

Structs§

RelayedTransportMethod
The tier-6 relayed-transport (TURN-like) method — proxies ALL peer data through the relay. Only reached when every more-direct method (including the tier-5 hole punch) has failed.

Traits§

RelayedTransport
Abstraction over the relay data plane: open a stream to target_peer whose bytes are proxied THROUGH the relay (RLY-002). This is the tier-6 TURN-like fallback — distinct from the tier-5 HolePunchCoordinator, which only signals.