Struct quinn_proto::ServerConfig
source · pub struct ServerConfig {
pub transport: Arc<TransportConfig>,
pub crypto: Arc<dyn ServerConfig>,
/* private fields */
}
Expand description
Parameters governing incoming connections
Default values should be suitable for most internet applications.
Fields§
§transport: Arc<TransportConfig>
Transport configuration to use for incoming connections
crypto: Arc<dyn ServerConfig>
TLS configuration used for incoming connections.
Must be set to use TLS 1.3 only.
Implementations§
source§impl ServerConfig
impl ServerConfig
sourcepub fn new(
crypto: Arc<dyn ServerConfig>,
token_key: Arc<dyn HandshakeTokenKey>
) -> Self
pub fn new( crypto: Arc<dyn ServerConfig>, token_key: Arc<dyn HandshakeTokenKey> ) -> Self
Create a default config with a particular handshake token key
sourcepub fn transport_config(&mut self, transport: Arc<TransportConfig>) -> &mut Self
pub fn transport_config(&mut self, transport: Arc<TransportConfig>) -> &mut Self
Set a custom TransportConfig
sourcepub fn token_key(&mut self, value: Arc<dyn HandshakeTokenKey>) -> &mut Self
pub fn token_key(&mut self, value: Arc<dyn HandshakeTokenKey>) -> &mut Self
Private key used to authenticate data included in handshake tokens.
sourcepub fn use_retry(&mut self, value: bool) -> &mut Self
pub fn use_retry(&mut self, value: bool) -> &mut Self
Whether to require clients to prove ownership of an address before committing resources.
Introduces an additional round-trip to the handshake to make denial of service attacks more difficult.
sourcepub fn retry_token_lifetime(&mut self, value: Duration) -> &mut Self
pub fn retry_token_lifetime(&mut self, value: Duration) -> &mut Self
Duration after a stateless retry token was issued for which it’s considered valid.
sourcepub fn concurrent_connections(&mut self, value: u32) -> &mut Self
pub fn concurrent_connections(&mut self, value: u32) -> &mut Self
Maximum number of simultaneous connections to accept.
New incoming connections are only accepted if the total number of incoming or outgoing connections is less than this. Outgoing connections are unaffected.
source§impl ServerConfig
impl ServerConfig
sourcepub fn with_single_cert(
cert_chain: Vec<Certificate>,
key: PrivateKey
) -> Result<Self, Error>
pub fn with_single_cert( cert_chain: Vec<Certificate>, key: PrivateKey ) -> Result<Self, Error>
Create a server config with the given certificate chain to be presented to clients
Uses a randomized handshake token key.
source§impl ServerConfig
impl ServerConfig
sourcepub fn with_crypto(crypto: Arc<dyn ServerConfig>) -> Self
pub fn with_crypto(crypto: Arc<dyn ServerConfig>) -> Self
Create a server config with the given crypto::ServerConfig
Uses a randomized handshake token key.
Trait Implementations§
source§impl Clone for ServerConfig
impl Clone for ServerConfig
source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more