pub struct QuicLoopConfig {Show 15 fields
pub announcement_cancellation: CancellationToken,
pub cert_chain: Vec<Vec<u8>>,
pub key_der: Zeroizing<Vec<u8>>,
pub bind_addr: SocketAddr,
pub server_name: String,
pub protected_resource_json: Option<Vec<u8>>,
pub on_quic_bound: Option<Box<dyn FnOnce(String, SocketAddr, String) + Send>>,
pub iroh_enabled: bool,
pub iroh_required: bool,
pub on_iroh_bound: Option<Box<dyn FnOnce(String, [u8; 32]) -> Result<()> + Send>>,
pub moq_relay: Option<TransportConfig>,
pub moq_relay_server_identity: Option<MoqlServerIdentity>,
pub moq_admission: Option<Arc<MoqlAdmissionAuthenticator>>,
pub moq_ingress_authorizer: Option<SharedIngressAuthorizer>,
pub moq_admission_proof: Option<MoqlAdmissionProof>,
}Expand description
REQ/REP message loop for RequestService.
Runs the REQ/REP message loop as an async task with TMQ for I/O. Uses proper async/await with epoll integration instead of blocking threads.
§Envelope Verification
The loop unwraps and verifies SignedEnvelope for every request:
- Deserialize
SignedEnvelopefrom wire bytes - Verify Ed25519 signature against server’s public key
- Check nonce not replayed (replay protection)
- Extract
EnvelopeContextand dispatch to handler
Invalid/unsigned requests are rejected with an error response.
§Usage
QUIC server configuration for the service loop.
Fields§
§announcement_cancellation: CancellationTokenCancels all announcements owned by this bound service before teardown.
cert_chain: Vec<Vec<u8>>DER-encoded certificate chain (leaf first, then intermediates/CA)
key_der: Zeroizing<Vec<u8>>DER-encoded private key — zeroed on drop.
bind_addr: SocketAddrAddress to bind the WebTransport server
server_name: StringTLS server name (for endpoint discovery registration)
protected_resource_json: Option<Vec<u8>>Pre-serialized RFC 9728 JSON for HTTP/3 .well-known/oauth-protected-resource
on_quic_bound: Option<Box<dyn FnOnce(String, SocketAddr, String) + Send>>Callback invoked after QUIC binding succeeds, with (service_name, actual_addr, server_name). Used to announce endpoints to the DiscoveryService.
iroh_enabled: bool#410/#282: when true (the default), the spawner binds an IrohSubstrate
as the PRIMARY production endpoint, serving BOTH ALPNs
(hyprstream-rpc/1 + moql) with the same request processor + moq
origin, and installs the shared client endpoint for outbound iroh dials.
The quinn endpoint is bound in parallel for back-compat. Native-only.
Set false (via [quic] iroh = false) to run quinn-only (legacy).
iroh_required: boolIroh is a startup/readiness requirement for native traffic. Quinn may still serve the browser edge but cannot satisfy this native contract.
on_iroh_bound: Option<Box<dyn FnOnce(String, [u8; 32]) -> Result<()> + Send>>#282: callback invoked after the iroh substrate binds, with
(service_name, node_id) where node_id is the endpoint’s 32-byte Ed25519
public carrier address. Used to advertise only an IrohTransport service
entry when bound; it must never become a verification method.
moq_relay: Option<TransportConfig>#358: the producer-chosen moq RELAY this node rendezvouses through, in
wire-reach form (crate::stream_info::TransportConfig). When set, the
spawner places it in the service’s ProducerReachConfig (so published
streams advertise a Role::Relay reach) and links this node’s
streaming origin UP to the relay
(crate::moq_stream::serve_origin_to_relay_background) — restoring the
rendezvous property: neither publisher nor subscriber need be directly
reachable by the other. Sourced from the resolved relay DID transport entry
(default: the PDS / federation anchor) decoded by the shared
crate::service_entry codec, so the stream relay and DID addresses never
drift. None = direct-only (the S1/S2 behaviour). Native-only.
moq_relay_server_identity: Option<MoqlServerIdentity>Resolver-verified accepted-state witness for moq_relay. Iroh relay
links require this distinct remote identity for mutual admission.
moq_admission: Option<Arc<MoqlAdmissionAuthenticator>>#1027: optional inside-carrier admission authenticator for the iroh
moql accept path. When set, every accepted moql connection must
prove an accepted current Ed25519 + ML-DSA-65 identity (fresh
challenge/response binding epoch/head/nonces) before the moq handshake;
the admitted peer is served only its resolved tenant’s scope. When
None, the pre-#1027 posture stands: anonymous carriers are refused.
Native-only.
Optional service-owned ingress authorization. The spawner forwards it unchanged to the Iroh MoQL handler; absence is deliberately read-only.
moq_admission_proof: Option<MoqlAdmissionProof>Native client proof for authenticated Iroh moql dials in this process.
Auto Trait Implementations§
impl Freeze for QuicLoopConfig
impl !RefUnwindSafe for QuicLoopConfig
impl Send for QuicLoopConfig
impl !Sync for QuicLoopConfig
impl Unpin for QuicLoopConfig
impl UnsafeUnpin for QuicLoopConfig
impl !UnwindSafe for QuicLoopConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more