WebServer (webserver) Configuration

Configuration of the HTTP server.

Type: io.helidon.webserver.WebServer

This is a standalone configuration type, prefix from configuration root: server

Configuration options

Optional configuration options
keytypedefault valuedescription
backlog

int

1024

Configures a maximum length of the queue of incoming connections on the server socket.

Default value is #DEFAULT_BACKLOG_SIZE.
backpressure-buffer-size

long

 

Maximum length of the response data sending buffer can keep without flushing. Depends on backpressure-policy what happens if max buffer size is reached.

backpressure-strategy

BackpressureStrategy (LINEAR, AUTO_FLUSH, PREFETCH, UNBOUNDED)

LINEAR

Sets a backpressure strategy for the server to apply against user provided response upstream.

  • LINEAR - Data are requested one-by-one, in case buffer reaches watermark, no other data is requested.

  • AUTO_FLUSH - Data are requested one-by-one, in case buffer reaches watermark, no other data is requested.

  • PREFETCH - After first data chunk arrives, probable number of chunks needed to fill the buffer up to watermark is calculated and requested.

  • NONE - No backpressure is applied, Long.MAX_VALUE(unbounded) is requested from upstream.

bind-address

string

 

Deprecated Configures local address where the server listens on with the server socket. If not configured, then listens an all local addresses.

enable-compression

boolean

false

Enable negotiation for gzip/deflate content encodings. Clients can request compression using the "Accept-Encoding" header.

Default is `false`
features.print-details

boolean

false

Set to true to print detailed feature information on startup.

host

string

 

A helper method that just calls #bindAddress(String).

max-header-size

int

16384

Maximal number of bytes of all header values combined. When a bigger value is received, a io.helidon.common.http.Http.Status#BAD_REQUEST_400 is returned.

Default is `16384`
max-initial-line-length

int

4096

Maximal number of characters in the initial HTTP line.

Default is `4096`
max-payload-size

long

 

Set a maximum payload size for a client request. Can prevent DoS attacks.

max-upgrade-content-length

int

65536

Set a maximum length of the content of an upgrade request.

Default is `64*1024`
port

int

0

Configures a server port to listen on with the server socket. If port is 0 then any available ephemeral port will be used.

receive-buffer-size

int

 

Configures proposed value of the TCP receive window that is advertised to the remote peer on the server socket.

If `0` then use implementation default.
continue-immediately

boolean

false

When true WebServer answers to expect continue with 100 continue immediately, not waiting for user to actually request the data. Default is false

requested-uri-discovery.enabled

boolean

true if 'types' or 'trusted-proxies' is set; false otherwise

Sets whether requested URI discovery is enabled for the socket.

requested-uri-discovery.trusted-proxies 

Assigns the settings governing the acceptance and rejection of forwarded headers from incoming requests to this socket. This setting automatically enables discovery for the socket.

requested-uri-discovery.types

RequestedUriDiscoveryType[] (FORWARDED, X_FORWARDED, HOST)

FORWARDED if discovery is enabled; none otherwise

Assigns the front-end URI discovery type(s) this socket should use. This setting automatically enables discovery for the socket.

sockets 

Adds an additional named server socket configuration. As a result, the server will listen on multiple ports.

An additional named server socket may have a dedicated Routing configured
through io.helidon.webserver.WebServer.Builder#addNamedRouting(String, Routing).
timeout-millis

long

0

Socket timeout in milliseconds

tls 

Configures SSL for this socket. When configured, the server enforces SSL configuration. If this method is called, any other method except for #tls(java.util.function.Supplier)¨ and repeated invocation of this method would be ignored.

If this method is called again, the previous configuration would be ignored.
worker-count

int

 

Sets a count of threads in pool used to process HTTP requests. Default value is CPU_COUNT * 2.

Configuration key: `workers`