Class QuicServerConfig
Configuration of a Quic server.
The default transport configuration, allows the server to accept bidi streams from a client with sensitive defaults values, it does not allow to accept uni streams nor allows the open streams toward the client.
- Author:
- Julien Viet
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final QuicClientAddressValidationstatic final KeyCertOptionsstatic final Durationstatic final booleanFields inherited from class QuicEndpointConfig
DEFAULT_MAX_STREAM_BIDI_REQUESTS, DEFAULT_MAX_STREAM_UNI_REQUESTS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetHost()intgetPort()booleansetClientAddressValidation(QuicClientAddressValidation clientAddressValidation) Configure the server to validate the client address using a (retry) token, by default this feature is disabled.setClientAddressValidationKey(KeyCertOptions validationKey) Set the cryptographic key used for client address validation tokens, thevalidationKeymust point to a keystore containing a private key / certificate pair or to a keystore containing symmetric key.setClientAddressValidationTimeWindow(Duration clientAddressValidationTimeWindow) Set the time window by which a Quic token issued by the server to a client remains valid.Set the hostsetIdleTimeout(Duration idleTimeout) Set the stream idle timeout, zero ornullmeans don't time out.setKeyLogFile(String keyLogFile) Configures the endpoint to dump the cryptographic secrets using in TLS in theSSLKEYLOGFILEformat.setLoadBalanced(boolean loadBalanced) Set totrueenables to bind multiples instances of a server on the same UDP port with theSO_REUSEoptions and let set of bound server route UDP packets to the correct server instance.setLogConfig(LogConfig config) Configure the log config: Netty's stream pipeline is configured for logging on Netty's logger.setMaxStreamBidiRequests(int maxStreamRequests) Set the maximum number of bidi stream requests per connection that can be queued when the connection stream bidi limit is reached.setMaxStreamUniRequests(int maxStreamRequests) Set the maximum number of unit stream requests per connection that can be queued when the connection stream uni limit is reached.setMetricsName(String metricsName) Set the metrics name identifying the reported metrics, useful for grouping metrics with the same name.setPort(int port) Set the portsetQLogConfig(QLogConfig qLogConfig) Set the endpoint QLog config.setReadIdleTimeout(Duration idleTimeout) Set the stream read idle timeout, zero ornullmeans or null means don't time out.setReuseAddress(boolean reuseAddress) Set the value of reuse address, used to bind the UDP socket underpinning the QUIC transport.setTransportConfig(QuicConfig transportConfig) setWriteIdleTimeout(Duration idleTimeout) Set the stream write idle timeout, zero ornullmeans don't time out.Methods inherited from class QuicEndpointConfig
getKeyLogFile, getMaxStreamBidiRequests, getMaxStreamUniRequests, getQLogConfig, getTransportConfig, isReuseAddressMethods inherited from class EndpointConfig
getIdleTimeout, getLogConfig, getMetricsName, getReadIdleTimeout, getWriteIdleTimeout
-
Field Details
-
DEFAULT_LOAD_BALANCED
public static final boolean DEFAULT_LOAD_BALANCED- See Also:
-
DEFAULT_CLIENT_ADDRESS_VALIDATION
-
DEFAULT_CLIENT_ADDRESS_VALIDATION_KEY
-
DEFAULT_CLIENT_ADDRESS_VALIDATION_TIME_WINDOW
-
-
Constructor Details
-
QuicServerConfig
public QuicServerConfig() -
QuicServerConfig
-
-
Method Details
-
setTransportConfig
- Overrides:
setTransportConfigin classQuicEndpointConfig
-
setQLogConfig
Description copied from class:QuicEndpointConfigSet the endpoint QLog config.
The config can point to a single file or to a directory where qlog files will be created.
- Overrides:
setQLogConfigin classQuicEndpointConfig- Parameters:
qLogConfig- the qlog config- Returns:
- this exact object instance
-
setKeyLogFile
Description copied from class:QuicEndpointConfigConfigures the endpoint to dump the cryptographic secrets using in TLS in the
SSLKEYLOGFILEformat.The file might exist or will be created (in which case the parent file must exist), content will be appended to the file.
This should be used only for debugging purpose and must not be used in production. This feature is disabled by default.
- Overrides:
setKeyLogFilein classQuicEndpointConfig- Parameters:
keyLogFile- the path to the key log file- Returns:
- this exact object instance
-
setIdleTimeout
Description copied from class:EndpointConfigSet the stream idle timeout, zero ornullmeans don't time out. This determines if a stream will timeout and be closed if no data is received nor sent within the timeout.- Overrides:
setIdleTimeoutin classQuicEndpointConfig- Parameters:
idleTimeout- the idle timeout- Returns:
- a reference to this, so the API can be used fluently
-
setReadIdleTimeout
Description copied from class:EndpointConfigSet the stream read idle timeout, zero or
nullmeans or null means don't time out. This determines if a stream will timeout and be closed if no data is received within the timeout.- Overrides:
setReadIdleTimeoutin classQuicEndpointConfig- Parameters:
idleTimeout- the read idle timeout- Returns:
- a reference to this, so the API can be used fluently
-
setWriteIdleTimeout
Description copied from class:EndpointConfigSet the stream write idle timeout, zero or
nullmeans don't time out. This determines if a stream will timeout and be closed if no data is sent within the timeout.- Overrides:
setWriteIdleTimeoutin classQuicEndpointConfig- Parameters:
idleTimeout- the write idle timeout- Returns:
- a reference to this, so the API can be used fluently
-
setLogConfig
Description copied from class:EndpointConfigConfigure the log config: Netty's stream pipeline is configured for logging on Netty's logger.- Overrides:
setLogConfigin classQuicEndpointConfig- Parameters:
config- the log config- Returns:
- a reference to this, so the API can be used fluently
-
setMetricsName
Description copied from class:EndpointConfigSet the metrics name identifying the reported metrics, useful for grouping metrics with the same name.- Overrides:
setMetricsNamein classQuicEndpointConfig- Parameters:
metricsName- the metrics name- Returns:
- a reference to this, so the API can be used fluently
-
setMaxStreamBidiRequests
Description copied from class:QuicEndpointConfigSet the maximum number of bidi stream requests per connection that can be queued when the connection stream bidi limit is reached.- Overrides:
setMaxStreamBidiRequestsin classQuicEndpointConfig- Parameters:
maxStreamRequests- the maximum value
-
setMaxStreamUniRequests
Description copied from class:QuicEndpointConfigSet the maximum number of unit stream requests per connection that can be queued when the connection stream uni limit is reached.- Overrides:
setMaxStreamUniRequestsin classQuicEndpointConfig- Parameters:
maxStreamRequests- the maximum value
-
setReuseAddress
Description copied from class:QuicEndpointConfigSet the value of reuse address, used to bind the UDP socket underpinning the QUIC transport.- Overrides:
setReuseAddressin classQuicEndpointConfig- Parameters:
reuseAddress- the value of reuse address- Returns:
- a reference to this, so the API can be used fluently
-
getPort
public int getPort()- Returns:
- the port
-
setPort
Set the port- Parameters:
port- the port- Returns:
- a reference to this, so the API can be used fluently
-
getHost
- Returns:
- the host
-
setHost
Set the host- Parameters:
host- the host- Returns:
- a reference to this, so the API can be used fluently
-
isLoadBalanced
public boolean isLoadBalanced()- Returns:
- whether the server is load balanced
-
setLoadBalanced
Set totrueenables to bind multiples instances of a server on the same UDP port with theSO_REUSEoptions and let set of bound server route UDP packets to the correct server instance.- Parameters:
loadBalanced- whether the server can be load balanced- Returns:
- this exact object instance
-
getClientAddressValidation
- Returns:
- whether the server performs address validation
-
setClientAddressValidation
public QuicServerConfig setClientAddressValidation(QuicClientAddressValidation clientAddressValidation) Configure the server to validate the client address using a (retry) token, by default this feature is disabled. You should enable this feature for production servers.
Client address validation requires you to also
seta key for token signing/verification.- Parameters:
clientAddressValidation- whether to perform address validation- Returns:
- this exact object instance
-
getClientAddressValidationTimeWindow
- Returns:
- the client address validation token time window
-
setClientAddressValidationTimeWindow
public QuicServerConfig setClientAddressValidationTimeWindow(Duration clientAddressValidationTimeWindow) Set the time window by which a Quic token issued by the server to a client remains valid.- Parameters:
clientAddressValidationTimeWindow- the client address validation time window- Returns:
- this exact object instance
-
getClientAddressValidationKey
- Returns:
- the cryptographic key used for client address validation tokens
-
setClientAddressValidationKey
Set the cryptographic key used for client address validation tokens, thevalidationKeymust point to a keystore containing a private key / certificate pair or to a keystore containing symmetric key.- Parameters:
validationKey- the validation key- Returns:
- this exact object instance
-