Class ServerConfig


  • public final class ServerConfig
    extends Object
    Server configuration.
    • Method Detail

      • defaultVirtualHost

        public VirtualHost defaultVirtualHost()
        Returns the default VirtualHost, which is used when no other VirtualHosts match the host name of a client request. e.g. the "Host" header in HTTP or host name in TLS SNI extension
        See Also:
        virtualHosts()
      • findVirtualHosts

        public List<VirtualHost> findVirtualHosts​(Service<?,?> service)
        Finds the List of VirtualHosts that contains the specified Service. If there's no match, an empty List is returned. Note that this is potentially an expensive operation and thus should not be used in a performance-sensitive path.
      • shutdownWorkerGroupOnStop

        public boolean shutdownWorkerGroupOnStop()
        Returns whether the worker EventLoopGroup is shut down when the Server stops.
      • maxNumConnections

        public int maxNumConnections()
        Returns the maximum allowed number of open connections.
      • idleTimeoutMillis

        public long idleTimeoutMillis()
        Returns the idle timeout of a connection in milliseconds for keep-alive.
      • defaultRequestTimeoutMillis

        public long defaultRequestTimeoutMillis()
        Returns the default timeout of a request.
      • defaultMaxRequestLength

        public long defaultMaxRequestLength()
        Returns the default maximum allowed length of the content decoded at the session layer. e.g. the content length of an HTTP request.
      • defaultMaxHttp1InitialLineLength

        public int defaultMaxHttp1InitialLineLength()
        Returns the default maximum length of an HTTP/1 response initial line.
      • defaultMaxHttp1HeaderSize

        public int defaultMaxHttp1HeaderSize()
        Returns the default maximum length of all headers in an HTTP/1 response.
      • defaultMaxHttp1ChunkSize

        public int defaultMaxHttp1ChunkSize()
        Returns the default maximum length of each chunk in an HTTP/1 response content. The content or a chunk longer than this value will be split into smaller chunks so that their lengths never exceed it.
      • gracefulShutdownQuietPeriod

        public Duration gracefulShutdownQuietPeriod()
        Returns the number of milliseconds to wait for active requests to go end before shutting down. 0 means the server will stop right away without waiting.
      • gracefulShutdownTimeout

        public Duration gracefulShutdownTimeout()
        Returns the number of milliseconds to wait before shutting down the server regardless of active requests.
      • serviceLoggerPrefix

        public String serviceLoggerPrefix()
        Returns the prefix of service logger's names.
      • accessLogWriter

        public Consumer<RequestLog> accessLogWriter()
        Returns an access log writer.
      • proxyProtocolMaxTlvSize

        public int proxyProtocolMaxTlvSize()
        Returns the maximum size of additional data (TLV, Tag-Length-Value). It is only used when PROXY protocol is enabled on the server port.