Skip to main content

serve

Function serve 

Source
pub async fn serve<C, B>(
    conn: C,
    bus: B,
    ingress: IngressSocket,
    path: SessionPath,
    webrtc: Option<Arc<dyn WebRtcSignaling>>,
) -> Result<(), SessionEnd>
where C: SessionStreams + 'static, B: HostBus + 'static,
Expand description

Serve one authenticated peer connection until it ends.

webrtc is the carrier hook for webrtc.signal/1. Pass Some when the carrier can answer WebRTC on this connection (iroh); pass None to refuse with unsupported_transport.

Does not touch a SessionRegistry. Carriers that need live-session revalidation should call serve_with_registry instead. Carriers that need wire/1 should call serve_with_options.