pub struct Server { /* private fields */ }Expand description
Server for accepting MoQ connections over QUIC.
Create via ServerConfig::init or Server::new.
Implementations§
Source§impl Server
impl Server
pub fn new(config: ServerConfig) -> Result<Self>
Sourcepub fn with_websocket(self, websocket: Option<WebSocketListener>) -> Self
pub fn with_websocket(self, websocket: Option<WebSocketListener>) -> Self
Add a standalone WebSocket listener on a separate TCP port.
This is useful for simple applications that want WebSocket on a dedicated port.
For applications that need WebSocket on the same HTTP port (e.g. moq-relay),
use qmux::Session::accept() with your own HTTP framework instead.
pub fn with_publish(self, publish: impl Into<Option<OriginConsumer>>) -> Self
pub fn with_consume(self, consume: impl Into<Option<OriginProducer>>) -> Self
Sourcepub fn with_stats(self, stats: StatsHandle) -> Self
pub fn with_stats(self, stats: StatsHandle) -> Self
Attach a tier-scoped moq_net::StatsHandle to all sessions accepted by this server.
pub fn tls_info(&self) -> Arc<RwLock<ServerTlsInfo>> ⓘ
Sourcepub async fn accept(&mut self) -> Option<Request>
pub async fn accept(&mut self) -> Option<Request>
Returns the next partially established QUIC or WebTransport session.
This returns a Request instead of a web_transport_quinn::Session so the connection can be rejected early on an invalid path or missing auth.
The Request is either a WebTransport or a raw QUIC request. Call Request::ok or Request::close to complete the handshake.