pub struct Server { /* private fields */ }Expand description
Shared WebRTC media state that hands axum routers to the caller.
Implementations§
Source§impl Server
impl Server
Sourcepub fn publish_router(&self, publisher: Producer) -> Router
pub fn publish_router(&self, publisher: Producer) -> Router
Router for server publish (WHIP). Mount under whichever HTTP path
the deployment prefers (/whip, /, …).
The router derives the broadcast name from the request path and performs
no authentication. To own the route and authorize requests yourself
(resolving the broadcast name from a verified token), skip the router and
call whip::accept directly from your own handler.
Sourcepub fn subscribe_router(&self, subscriber: Consumer) -> Router
pub fn subscribe_router(&self, subscriber: Consumer) -> Router
Router for server subscribe (WHEP). Mount under whichever HTTP path
the deployment prefers (/whep, /, …).
The router derives the broadcast name from the request path and performs
no authentication. To own the route and authorize requests yourself
(resolving the broadcast name from a verified token), skip the router and
call whep::accept directly from your own handler.
Sourcepub fn terminate(&self, resource_id: &str) -> bool
pub fn terminate(&self, resource_id: &str) -> bool
Terminate a negotiated session by its resource id (the Location path
component from the WHIP/WHEP response). Returns true if a live session
was found and signalled to stop; the session task then releases its
broadcast announcement and mux registration. Embedders that own their own
HTTP routing call this to honor a WHIP/WHEP DELETE; the bundled routers
already wire it to the DELETE method.