pub struct Listener { /* private fields */ }Expand description
A transport-agnostic MoQT listener that accepts both raw-QUIC and WebTransport clients on the same UDP port.
Implementations§
Source§impl Listener
impl Listener
Sourcepub fn bind(config: ListenerConfig) -> Result<Self, ProxyError>
pub fn bind(config: ListenerConfig) -> Result<Self, ProxyError>
Bind to the configured address and start listening.
The listener advertises every supported MoQT ALPN (moq-00 and
moqt-<N> for all known drafts) plus h3 for WebTransport. The
client picks which one to speak; the proxy forwards whatever
arrives.
Sourcepub async fn accept(&self) -> Result<AcceptedConn, ProxyError>
pub async fn accept(&self) -> Result<AcceptedConn, ProxyError>
Accept the next incoming connection and dispatch based on the ALPN negotiated during the TLS handshake.
Raw-QUIC connections are returned immediately with the negotiated
ALPN so the caller can pick the MoQT draft. For h3 clients the
listener drives the HTTP/3 + extended-CONNECT handshake to
completion before returning a ready [wtransport::Connection].
Sourcepub fn local_addr(&self) -> Result<SocketAddr, ProxyError>
pub fn local_addr(&self) -> Result<SocketAddr, ProxyError>
Get the local address this listener is bound to.