Interface HttpServerConfiguration


public interface HttpServerConfiguration

HTTP server module configuration.

Since:
1.0
Author:
Jeremy Kuhn
  • Method Details

    • server_host

      default String server_host()

      The host name of the server socket address.

      Defaults to 0.0.0.0.

      Returns:
      the server host name
    • server_port

      default int server_port()

      The port of the server socket address.

      Defaults to 8080.

      Returns:
      the server port
    • server_event_loop_group_size

      Integer server_event_loop_group_size()

      The number of event loops to allocate to the server.

      If not specified, the number of thread allocated to the root event loop group shall be used.

      Returns:
      the number of threads to allocate
    • graceful_shutdown

      default boolean graceful_shutdown()

      Tries to gracefully shutdown active connections when stopping the server.

      Note that a connection is always gracefully shutdown when receiving a GO_AWAY HTTP/2 frame.

      Defaults to false.

      Returns:
      true to try to gracefully shutdown the server, false otherwise
    • graceful_shutdown_timeout

      default long graceful_shutdown_timeout()

      The graceful shutdown timeout in milliseconds after which a connection is closed even if there are still active exchanges.

      Defaults to 30000.

      Returns:
      the graceful shutdown timeout
    • compression_enabled

      default boolean compression_enabled()

      Enables/Disables HTTP compression.

      Defaults to false.

      Returns:
      true if compression is enabled, false otherwise
    • decompression_enabled

      default boolean decompression_enabled()

      Enables/Disables HTTP decompression.

      Defaults to false.

      Returns:
      true if decompression is enabled, false otherwise
    • compression_contentSizeThreshold

      default int compression_contentSizeThreshold()

      The threshold beyond which the response body should be compressed.

      Defaults to 0 which means all responses are compressed.

      Returns:
      the compression content size threshold
    • compression_brotli_quality

      default int compression_brotli_quality()

      Brotly compression quality.

      Defaults to 4.

      Returns:
      the brotli compression quality
    • compression_brotli_window

      default int compression_brotli_window()

      Brotly compression window.

      Defaults to -1.

      Returns:
      the brotli compression window
    • compression_brotli_mode

      default int compression_brotli_mode()

      Brotly compression mode (0=GENERIC, 1=TEXT, 2=FONT).

      Defaults to 1 (TEXT).

      Returns:
      the brotli compression mode
    • compression_deflate_compressionLevel

      default int compression_deflate_compressionLevel()

      Deflate compression level.

      Defaults to 6.

      Returns:
      the deflate compression level
    • compression_deflate_windowBits

      default int compression_deflate_windowBits()

      Deflate compression window bits.

      Defaults to 15.

      Returns:
      the deflate compression window bits
    • compression_deflate_memLevel

      default int compression_deflate_memLevel()

      Deflate compression memory level.

      Defaults to 8.

      Returns:
      the deflate compression memory level bits
    • compression_gzip_compressionLevel

      default int compression_gzip_compressionLevel()

      Gzip compression level.

      Defaults to 6.

      Returns:
      the gzip compression level
    • compression_gzip_windowBits

      default int compression_gzip_windowBits()

      Gzip compression window bits.

      Defaults to 15.

      Returns:
      the gzip compression window bits
    • compression_gzip_memLevel

      default int compression_gzip_memLevel()

      Gzip compression memory level.

      Defaults to 8.

      Returns:
      the gzip compression memory level
    • compression_zstd_blockSize

      default int compression_zstd_blockSize()

      Zstandard compression block size (in bytes).

      Defaults to 64KB.

      Returns:
      the zstd compression block size
    • compression_zstd_compressionLevel

      default int compression_zstd_compressionLevel()

      Zstandard compression level.

      Defaults to 3.

      Returns:
      the zstd compression level
    • compression_zstd_maxEncodeSize

      default int compression_zstd_maxEncodeSize()

      Zstandard compression max encode size in bytes.

      Defaults to 32MB.

      Returns:
      the zstd compression max encode size
    • tls_enabled

      default boolean tls_enabled()

      Enables/Disables HTTPS.

      Defaults to false.

      Returns:
      true if the option is enabled, false otherwise
    • tls_key_store

      URI tls_key_store()

      The path to the key store.

      Returns:
      the key store URI
    • tls_key_store_type

      default String tls_key_store_type()

      The type of key store.

      Defaults to JKS.

      Returns:
      the key store type
    • tls_key_store_password

      String tls_key_store_password()

      The password of the key store.

      Returns:
      a password
    • tls_key_alias

      String tls_key_alias()

      The alias of the key in the key store.

      Returns:
      a key alias
    • tls_key_alias_password

      String tls_key_alias_password()

      The password for the alias of the key in the key store.

      Returns:
      a password
    • tls_client_auth

      default HttpServerConfiguration.ClientAuth tls_client_auth()

      The client authentication type.

      Defaults to HttpServerConfiguration.ClientAuth.NONE.

      Returns:
    • tls_trust_store

      URI tls_trust_store()

      The path to the key store.

      Note that this overrides tls_trust_manager_factory().

      Returns:
      the key store URI
    • tls_trust_store_type

      default String tls_trust_store_type()

      The type of key store.

      Defaults to JKS.

      Returns:
      the key store type
    • tls_trust_store_password

      String tls_trust_store_password()

      The password of the key store.

      Returns:
      a password
    • tls_trust_manager_factory

      TrustManagerFactory tls_trust_manager_factory()

      The trust manager factory.

      Returns:
      the trust manager factory
    • tls_handshake_timeout

      default long tls_handshake_timeout()

      TLS handshake timeout (ms).

      Defaults to 10000.

      Returns:
      the TLS handshake timeout
    • tls_ciphers_includes

      String[] tls_ciphers_includes()

      The list of ciphers to include.

      Returns:
      a list of ciphers
    • tls_ciphers_excludes

      String[] tls_ciphers_excludes()

      The list of ciphers to exclude.

      Returns:
      a list of ciphers
    • http1x_initial_buffer_size

      default int http1x_initial_buffer_size()

      HTTP/1.x initial buffer size in bytes used when parsing the lines of the HTTP headers.

      Defaults to 128.

      Returns:
      the initial buffer size
    • http1x_max_initial_line_length

      default int http1x_max_initial_line_length()

      HTTP/1.x max length in bytes of the first line of the HTTP headers.

      Defaults to 4096.

      Returns:
      the max initial line length
    • http1x_max_chunk_size

      default int http1x_max_chunk_size()

      HTTP/1.x max chunk size in bytes.

      Defaults to 8192.

      Returns:
      the max chunk size
    • http1x_max_header_size

      default int http1x_max_header_size()

      HTTP/1.x max header line size in bytes.

      Defaults to 8192.

      Returns:
      the max header line size
    • http1x_validate_headers

      default boolean http1x_validate_headers()

      Enables/Disables HTTP/1.x header validation.

      It is recommended to always validate headers in order to prevent request/response splitting attack.

      Defaults to true.

      Returns:
      true to validate headers, false otherwise
    • h2_enabled

      default boolean h2_enabled()

      Enables/Disables HTTP/2.

      When SSL is disabled, the property enables/disables Http/2 over cleartext (H2C) protocol as decribed by RFC 7540 Section 3.2.

      Defaults to true when TLS is enabled, false otherwise.

      Returns:
      true if the option is enabled, false otherwise
    • h2c_max_content_length

      default int h2c_max_content_length()

      The maximum length in bytes of the content of an H2C upgrade request.

      Defaults to 8192.

      Returns:
      the maximum content length of an H2C upgrade request
    • http2_header_table_size

      default Long http2_header_table_size()

      The HTTP/2 header table size.

      Defaults to 4096.

      Returns:
      the header table size
    • http2_max_concurrent_streams

      default Integer http2_max_concurrent_streams()

      HTTP/2 max concurrent streams.

      Defaults to 100.

      Returns:
      max concurrent streams
    • http2_initial_window_size

      default Integer http2_initial_window_size()

      HTTP/2 initial window size.

      Defaults to 65535.

      Returns:
      initial window size
    • http2_max_frame_size

      default Integer http2_max_frame_size()

      HTTP/2 max frame size.

      Defaults to 16384.

      Returns:
      max frame size
    • http2_max_header_list_size

      default Integer http2_max_header_list_size()

      HTTP/2 max header list size.

      Defaults to Integer.MAX_VALUE.

      Returns:
      max header list size
    • http2_validate_headers

      default boolean http2_validate_headers()

      Enables/Disables HTTP/2.0 header validation as defined by RFC 7540 Section 8.1.2.6.

      Defaults to true.

      Returns:
      true to validate headers, false otherwise
    • ws_enabled

      default boolean ws_enabled()

      Enables/Disables WebSocket support.

      Defaults to true.

      Returns:
      true to enable WebSocket support, false otherwise
    • ws_handshake_timeout

      default long ws_handshake_timeout()

      WebSocket handshake timeout (ms).

      Defaults to -1 (i.e. no timeout).

      Returns:
      the WebSocket handshake timeout
    • ws_close_timeout

      default long ws_close_timeout()

      WebSocket close timeout (ms).

      Defaults to -1 (i.e. no timeout).

      Returns:
      the WebSocket close timeout
    • ws_max_frame_size

      default Integer ws_max_frame_size()

      WebSocket max frame size in bytes.

      Defaults to 65536.

      Returns:
      the WebSocket max frame size
    • ws_allow_mask_mismatch

      default boolean ws_allow_mask_mismatch()

      Accepts/Rejects unproperly masked WebSocket frames.

      Defaults to false.

      Returns:
      true to allow unproperly masked frames, false otherwise
    • ws_frame_compression_enabled

      default boolean ws_frame_compression_enabled()

      Enables/Disables WebSocket per frame compression.

      Defaults to false.

      Returns:
      true if WebSocket per frame is enabled, false otherwise
    • ws_frame_compression_level

      default int ws_frame_compression_level()

      WebSocket per frame compression level.

      Defaults to 6.

      Returns:
      the WebSocket frame compression level
    • ws_message_compression_enabled

      default boolean ws_message_compression_enabled()

      Enables/Disables WebSocket per message compression.

      Defaults to false.

      Returns:
      true if WebSocket per message is enabled, false otherwise
    • ws_message_compression_level

      default int ws_message_compression_level()

      WebSocket per message compression level.

      Defaults to 6.

      Returns:
      the WebSocket message compression level
    • ws_message_allow_server_window_size

      default boolean ws_message_allow_server_window_size()

      Allows WebSocket client to customize the server inflater window size.

      Defaults to false.

      Returns:
      true to allow clients to customize the server inflater window size, false otherwise
    • ws_message_prefered_client_window_size

      default int ws_message_prefered_client_window_size()

      The prefered client window size to use if client inflater is customizable.

      Defaults to 15.

      Returns:
      the prefered client window size
    • ws_message_allow_server_no_context

      default boolean ws_message_allow_server_no_context()

      Allows WebSocket client to activate server_no_context_takeover.

      Defaults to false.

      Returns:
      true to allow clients to activate server_no_context_takeover, false otherwise
    • ws_message_preferred_client_no_context

      default boolean ws_message_preferred_client_no_context()

      Indicates if server prefers to activate client_no_context_takeover if client supports it.

      Defaults to false.

      Returns:
      true to activate client_no_context_takeover if client supports it, false otherwise
    • ws_close_on_outbound_complete

      default boolean ws_close_on_outbound_complete()

      Indicates whether a WebSocket should be closed when the outbound frames publisher completes.

      Note that this behaviour can be overridden by invoking BaseWebSocketExchange.Outbound.closeOnComplete(boolean) on the WebSocket exchange's outbound.

      Defaults to false

      Returns:
      true to close the WebSocket when the outbound frames publisher completes, false otherwise.
    • ws_inbound_close_frame_timeout

      default long ws_inbound_close_frame_timeout()

      The time in milliseconds to wait after a close frame has been sent for a close frame to be received before closing the WebSocket unilaterally.

      Defaults to 60000.

      Returns:
      the inbound close frame timeout