Class QuicServerConfig


@Unstable public class QuicServerConfig extends QuicEndpointConfig

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 Details

    • DEFAULT_LOAD_BALANCED

      public static final boolean DEFAULT_LOAD_BALANCED
      See Also:
    • DEFAULT_CLIENT_ADDRESS_VALIDATION

      public static final QuicClientAddressValidation DEFAULT_CLIENT_ADDRESS_VALIDATION
    • DEFAULT_CLIENT_ADDRESS_VALIDATION_KEY

      public static final KeyCertOptions DEFAULT_CLIENT_ADDRESS_VALIDATION_KEY
    • DEFAULT_CLIENT_ADDRESS_VALIDATION_TIME_WINDOW

      public static final Duration DEFAULT_CLIENT_ADDRESS_VALIDATION_TIME_WINDOW
  • Constructor Details

    • QuicServerConfig

      public QuicServerConfig()
    • QuicServerConfig

      public QuicServerConfig(QuicServerConfig other)
  • Method Details

    • setTransportConfig

      public QuicServerConfig setTransportConfig(QuicConfig transportConfig)
      Overrides:
      setTransportConfig in class QuicEndpointConfig
    • setQLogConfig

      public QuicServerConfig setQLogConfig(QLogConfig qLogConfig)
      Description copied from class: QuicEndpointConfig

      Set the endpoint QLog config.

      The config can point to a single file or to a directory where qlog files will be created.

      Overrides:
      setQLogConfig in class QuicEndpointConfig
      Parameters:
      qLogConfig - the qlog config
      Returns:
      this exact object instance
    • setKeyLogFile

      public QuicServerConfig setKeyLogFile(String keyLogFile)
      Description copied from class: QuicEndpointConfig

      Configures the endpoint to dump the cryptographic secrets using in TLS in the SSLKEYLOGFILE format.

      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:
      setKeyLogFile in class QuicEndpointConfig
      Parameters:
      keyLogFile - the path to the key log file
      Returns:
      this exact object instance
    • setIdleTimeout

      public QuicServerConfig setIdleTimeout(Duration idleTimeout)
      Description copied from class: EndpointConfig
      Set the stream idle timeout, zero or null means 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:
      setIdleTimeout in class QuicEndpointConfig
      Parameters:
      idleTimeout - the idle timeout
      Returns:
      a reference to this, so the API can be used fluently
    • setReadIdleTimeout

      public QuicServerConfig setReadIdleTimeout(Duration idleTimeout)
      Description copied from class: EndpointConfig

      Set the stream read idle timeout, zero or null means 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:
      setReadIdleTimeout in class QuicEndpointConfig
      Parameters:
      idleTimeout - the read idle timeout
      Returns:
      a reference to this, so the API can be used fluently
    • setWriteIdleTimeout

      public QuicServerConfig setWriteIdleTimeout(Duration idleTimeout)
      Description copied from class: EndpointConfig

      Set the stream write idle timeout, zero or null means don't time out. This determines if a stream will timeout and be closed if no data is sent within the timeout.

      Overrides:
      setWriteIdleTimeout in class QuicEndpointConfig
      Parameters:
      idleTimeout - the write idle timeout
      Returns:
      a reference to this, so the API can be used fluently
    • setLogConfig

      public QuicServerConfig setLogConfig(LogConfig config)
      Description copied from class: EndpointConfig
      Configure the log config: Netty's stream pipeline is configured for logging on Netty's logger.
      Overrides:
      setLogConfig in class QuicEndpointConfig
      Parameters:
      config - the log config
      Returns:
      a reference to this, so the API can be used fluently
    • setMetricsName

      public QuicServerConfig setMetricsName(String metricsName)
      Description copied from class: EndpointConfig
      Set the metrics name identifying the reported metrics, useful for grouping metrics with the same name.
      Overrides:
      setMetricsName in class QuicEndpointConfig
      Parameters:
      metricsName - the metrics name
      Returns:
      a reference to this, so the API can be used fluently
    • setMaxStreamBidiRequests

      public QuicServerConfig setMaxStreamBidiRequests(int maxStreamRequests)
      Description copied from class: QuicEndpointConfig
      Set the maximum number of bidi stream requests per connection that can be queued when the connection stream bidi limit is reached.
      Overrides:
      setMaxStreamBidiRequests in class QuicEndpointConfig
      Parameters:
      maxStreamRequests - the maximum value
    • setMaxStreamUniRequests

      public QuicServerConfig setMaxStreamUniRequests(int maxStreamRequests)
      Description copied from class: QuicEndpointConfig
      Set the maximum number of unit stream requests per connection that can be queued when the connection stream uni limit is reached.
      Overrides:
      setMaxStreamUniRequests in class QuicEndpointConfig
      Parameters:
      maxStreamRequests - the maximum value
    • setReuseAddress

      public QuicServerConfig setReuseAddress(boolean reuseAddress)
      Description copied from class: QuicEndpointConfig
      Set the value of reuse address, used to bind the UDP socket underpinning the QUIC transport.
      Overrides:
      setReuseAddress in class QuicEndpointConfig
      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

      public QuicServerConfig setPort(int port)
      Set the port
      Parameters:
      port - the port
      Returns:
      a reference to this, so the API can be used fluently
    • getHost

      public String getHost()
      Returns:
      the host
    • setHost

      public QuicServerConfig setHost(String host)
      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

      public QuicServerConfig setLoadBalanced(boolean loadBalanced)
      Set to true enables to bind multiples instances of a server on the same UDP port with the SO_REUSE options 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

      public QuicClientAddressValidation 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 set a key for token signing/verification.

      Parameters:
      clientAddressValidation - whether to perform address validation
      Returns:
      this exact object instance
    • getClientAddressValidationTimeWindow

      public Duration 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

      public KeyCertOptions getClientAddressValidationKey()
      Returns:
      the cryptographic key used for client address validation tokens
    • setClientAddressValidationKey

      public QuicServerConfig setClientAddressValidationKey(KeyCertOptions validationKey)
      Set the cryptographic key used for client address validation tokens, the validationKey must 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