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 — ReservationRelayedTransport — opens an RLY-002 forwarding channel to the target peer THROUGH the node’s persistent relay reservation socket (never a second connection), and hands the caller a RelayTunnel for the byte stream.

Structs§

RelayedDialMethod
The relayed (tier-6, TURN-last) traversal method built over a RelayedDialer. Its attempt confirms the relay reservation is ready and yields the relay endpoint as the dial address; the actual byte tunnel + mTLS is opened by the dialer. This is the method crate::connect auto-composes for the relayed tier (given a runtime RelayedDialer).
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.
ReservationRelayedTransport
The PRODUCTION RelayedTransport: opens the RLY-002 forwarding channel over the node’s LIVE persistent relay reservation (never a second socket), reusing the same RelayStatus handle the reservation loop publishes its outbound sink through. This is the tier-6 TURN fallback made real.

Traits§

RelayedDialer
A relayed transport that opens the DUPLEX BYTE TUNNEL an mTLS session runs over — the transport half of the tier-6 relayed dial. Distinct from RelayedTransport (which only reports a probe endpoint): this yields the actual byte channel, so a relayed connection carries the SAME dig-tls mTLS + peer_id pin + BLS binding as a direct one (the relay forwards ciphertext it cannot read).
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.