pub struct MoqServer { /* private fields */ }Expand description
A MoQ server that accepts incoming QUIC/WebTransport sessions.
Implementations§
Source§impl MoqServer
impl MoqServer
Sourcepub fn set_bind(&self, addr: String) -> Result<(), MoqError>
pub fn set_bind(&self, addr: String) -> Result<(), MoqError>
Set the address to bind, e.g. 127.0.0.1:4443, [::]:443, or localhost:0.
Validated syntactically up-front. DNS hostnames are accepted and resolved
at listen() time.
Sourcepub fn set_tls_cert(&self, paths: Vec<String>)
pub fn set_tls_cert(&self, paths: Vec<String>)
Load TLS certificate chains from PEM files on disk.
Sourcepub fn set_tls_key(&self, paths: Vec<String>)
pub fn set_tls_key(&self, paths: Vec<String>)
Load TLS private keys from PEM files on disk.
Sourcepub fn set_tls_generate(&self, hostnames: Vec<String>)
pub fn set_tls_generate(&self, hostnames: Vec<String>)
Generate self-signed TLS certificates for the given hostnames.
Clients must either pin the certificate fingerprint or disable verification.
Sourcepub fn set_publish(&self, origin: Option<Arc<MoqOriginProducer>>)
pub fn set_publish(&self, origin: Option<Arc<MoqOriginProducer>>)
Set the origin to publish broadcasts to incoming sessions.
Sourcepub fn set_consume(&self, origin: Option<Arc<MoqOriginProducer>>)
pub fn set_consume(&self, origin: Option<Arc<MoqOriginProducer>>)
Set the origin to consume broadcasts from incoming sessions.
Sourcepub async fn listen(&self) -> Result<String, MoqError>
pub async fn listen(&self) -> Result<String, MoqError>
Bind the listening socket. Returns the bound local address as a string,
which is useful when binding to an ephemeral port (:0).
Sourcepub async fn accept(&self) -> Result<Option<Arc<MoqRequest>>, MoqError>
pub async fn accept(&self) -> Result<Option<Arc<MoqRequest>>, MoqError>
Accept the next incoming session. Returns None when the server has closed.
listen() must be called first.