Skip to main content

ListenerConfig

Struct ListenerConfig 

Source
pub struct ListenerConfig {
    pub bind_addr: SocketAddr,
    pub cert_chain: Vec<CertificateDer<'static>>,
    pub key_der: PrivateKeyDer<'static>,
    pub transport_config: Option<Arc<TransportConfig>>,
    pub transport_profile: Option<TransportProfile>,
    pub installer: Option<Arc<dyn TransportInstaller>>,
}
Expand description

Configuration for the proxy’s listener.

Fields§

§bind_addr: SocketAddr

Address to bind to (e.g., "0.0.0.0:4443").

§cert_chain: Vec<CertificateDer<'static>>

TLS certificate chain (DER-encoded).

§key_der: PrivateKeyDer<'static>

TLS private key (DER-encoded).

§transport_config: Option<Arc<TransportConfig>>

Optional QUIC transport parameters — flow-control windows, MTU, keep-alive, congestion control — applied to every client connection this listener accepts.

None leaves quinn’s defaults in place, which is the behaviour callers had before this field existed.

Setting this and ListenerConfig::transport_profile is refused by Listener::bind rather than merged, with ProxyError::TransportConfigAndProfile naming Leg::Client — see that variant for why no merge is possible.

§transport_profile: Option<TransportProfile>

The same parameters as ListenerConfig::transport_config, as a value that can be written down, checked and stored.

Some(_) builds the client leg’s quinn::TransportConfig from this profile — through ListenerConfig::installer, or through transport::DefaultInstaller when there is none — and installs it before the endpoint exists. A profile the installer refuses is ProxyError::TransportProfile, and nothing is bound.

None is the behaviour callers had before this field existed. It is the only alternative to transport_config, never a companion to it: a leg naming both is refused at bind time.

§installer: Option<Arc<dyn TransportInstaller>>

How ListenerConfig::transport_profile becomes the config this leg installs.

None uses transport::DefaultInstaller, which applies the profile over a fresh quinn::TransportConfig::default(). Supply one to start from a base of your own instead — the trait exists because a quinn::TransportConfig cannot be cloned, so the only way to have a base and a profile is to build the base again for each leg.

Inert without a profile. TransportInstaller::build takes a profile, so an installer set beside an empty ListenerConfig::transport_profile is never called and the leg installs nothing. It is said here because a setting that is quietly ignored is the failure this crate is least willing to hide.

It composes with a qlog spec — named in plain code font because that field exists only under the qlog feature, so a link from this always-compiled one would not resolve. A leg carrying a profile, a spec and an installer builds its config here, once, and the capture sink is attached to what came back; TransportInstaller::build returns an owned quinn::TransportConfig precisely so that the two can stack.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more