pub struct Client { /* private fields */ }Expand description
Outbound WHIP/WHEP dialer.
Owns a reqwest::Client reused across calls so connection pooling and
rustls config survive between resources.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(config: Config) -> Self
pub fn new(config: Config) -> Self
Build a dialer from the shared client Config. The underlying
reqwest::Client (with its connection pool and rustls config) is created
once here and reused across every subscribe /
publish call.
Sourcepub async fn subscribe(&self, url: Url, broadcast: Producer) -> Result<()>
pub async fn subscribe(&self, url: Url, broadcast: Producer) -> Result<()>
client subscribe: pull a remote WHEP feed and publish it as
broadcast on the local origin. Returns once the session is
running in the background.
Sourcepub async fn publish(
&self,
url: Url,
origin: Consumer,
path: impl AsPath,
) -> Result<()>
pub async fn publish( &self, url: Url, origin: Consumer, path: impl AsPath, ) -> Result<()>
client publish: pull the broadcast at path from origin and push it to a
remote WHIP endpoint. Gated on the per-codec re-packetizer.
Taking the origin plus path (rather than a resolved moq_net::broadcast::Consumer)
lets the egress resolve a rendition whose catalog broadcast field references a
sibling broadcast, against the same origin.