Package io.quarkus.vertx.http.runtime
Class HttpConfiguration
- java.lang.Object
-
- io.quarkus.vertx.http.runtime.HttpConfiguration
-
@ConfigRoot(phase=RUN_TIME) public class HttpConfiguration extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHttpConfiguration.InsecureRequestsstatic classHttpConfiguration.PayloadHint
-
Field Summary
Fields Modifier and Type Field Description (package private) AccessLogConfigaccessLogOptional<Boolean>allowForwardedDeprecated.use quarkus.http.proxy.allow-forwarded instead.BodyConfigbodyRequest body related settingsCORSConfigcorsThe CORS configbooleancorsEnabledEnable the CORS filter.StringdomainSocketPath to a unix domain socketbooleandomainSocketEnabledEnable listening to host:portbooleanenableCompressionIf responses should be compressed.booleanenableDecompressionWhen enabled, vert.x will decompress the request's body if it's compressed.Optional<String>encryptionKeyThe encryption key that is used to store persistent logins (e.g.Map<String,HeaderConfig>headerAdditional HTTP Headers always sent in the responseStringhostThe HTTP host In dev/test mode this defaults to localhost, in prod mode this defaults to 0.0.0.0 Defaulting to 0.0.0.0 makes it easier to deploy Quarkus to container, however it is not suitable for dev/test mode as other people on the network can connect to your development machine.booleanhostEnabledEnable listening to host:portbooleanhttp2If this is true (the default) then HTTP/2 will be enabled.DurationidleTimeoutHttp connection idle timeoutHttpConfiguration.InsecureRequestsinsecureRequestsIf insecure (i.e.OptionalIntioThreadsThe number if IO threads used to perform IO.ServerLimitsConfiglimitsServer limits configurationintportThe HTTP portProxyConfigproxyOptional<Boolean>proxyAddressForwardingDeprecated.use quarkus.http.proxy.proxy-address-forwarding instead.DurationreadTimeoutHttp connection read timeout for blocking IO.booleanrecordRequestStartTimeIf this is true then the request start time will be recorded to enable logging of total request time.Map<String,SameSiteCookieConfig>sameSiteCookieConfiguration that allows setting the same site attributes for cookies.booleansoReusePortEnable socket reuse port (linux/macOs native transport only)ServerSslConfigsslThe SSL configintsslPortThe HTTPS portbooleantcpCorkEnable tcp cork (linux native transport only)booleantcpFastOpenEnable tcp fast open (linux native transport only)booleantcpQuickAckEnable tcp quick ack (linux native transport only)inttestPortThe HTTP port used to run testsinttestSslPortThe HTTPS port used to run testsOptional<HttpConfiguration.PayloadHint>unhandledErrorContentTypeDefaultProvides a hint (optional) for the default content type of responses generated for the errors not handled by the application.
-
Constructor Summary
Constructors Constructor Description HttpConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdeterminePort(LaunchMode launchMode)intdetermineSslPort(LaunchMode launchMode)
-
-
-
Field Detail
-
corsEnabled
@ConfigItem(name="cors") public boolean corsEnabled
Enable the CORS filter.
-
port
@ConfigItem(defaultValue="8080") public int port
The HTTP port
-
testPort
@ConfigItem(defaultValue="8081") public int testPort
The HTTP port used to run tests
-
host
@ConfigItem public String host
The HTTP host In dev/test mode this defaults to localhost, in prod mode this defaults to 0.0.0.0 Defaulting to 0.0.0.0 makes it easier to deploy Quarkus to container, however it is not suitable for dev/test mode as other people on the network can connect to your development machine.
-
hostEnabled
@ConfigItem(defaultValue="true") public boolean hostEnabled
Enable listening to host:port
-
sslPort
@ConfigItem(defaultValue="8443") public int sslPort
The HTTPS port
-
testSslPort
@ConfigItem(defaultValue="8444") public int testSslPort
The HTTPS port used to run tests
-
proxyAddressForwarding
@Deprecated @ConfigItem public Optional<Boolean> proxyAddressForwarding
Deprecated.use quarkus.http.proxy.proxy-address-forwarding instead.If this is true then the address, scheme etc will be set from headers forwarded by the proxy server, such asX-Forwarded-For. This should only be set if you are behind a proxy that sets these headers.
-
allowForwarded
@Deprecated @ConfigItem public Optional<Boolean> allowForwarded
Deprecated.use quarkus.http.proxy.allow-forwarded instead.If this is true and proxy address forwarding is enabled then the standardForwardedheader will be used, rather than the more common but not standardX-Forwarded-For.
-
insecureRequests
@ConfigItem(defaultValue="enabled") public HttpConfiguration.InsecureRequests insecureRequests
If insecure (i.e. http rather than https) requests are allowed. If this isenabledthen http works as normal.redirectwill still open the http port, but all requests will be redirected to the HTTPS port.disabledwill prevent the HTTP port from opening at all.
-
http2
@ConfigItem(defaultValue="true") public boolean http2
If this is true (the default) then HTTP/2 will be enabled. Note that for browsers to be able to use it HTTPS must be enabled, and you must be running on JDK11 or above, as JDK8 does not support ALPN.
-
cors
public CORSConfig cors
The CORS config
-
ssl
public ServerSslConfig ssl
The SSL config
-
ioThreads
@ConfigItem public OptionalInt ioThreads
The number if IO threads used to perform IO. This will be automatically set to a reasonable value based on the number of CPU cores if it is not provided. If this is set to a higher value than the number of Vert.x event loops then it will be capped at the number of event loops. In general this should be controlled by setting quarkus.vertx.event-loops-pool-size, this setting should only be used if you want to limit the number of HTTP io threads to a smaller number than the total number of IO threads.
-
limits
public ServerLimitsConfig limits
Server limits configuration
-
idleTimeout
@ConfigItem(defaultValue="30M", name="idle-timeout") public Duration idleTimeout
Http connection idle timeout
-
readTimeout
@ConfigItem(defaultValue="60s", name="read-timeout") public Duration readTimeout
Http connection read timeout for blocking IO. This is the maximum amount of time a thread will wait for data, before an IOException will be thrown and the connection closed.
-
body
public BodyConfig body
Request body related settings
-
encryptionKey
@ConfigItem(name="auth.session.encryption-key") public Optional<String> encryptionKey
The encryption key that is used to store persistent logins (e.g. for form auth). Logins are stored in a persistent cookie that is encrypted with AES-256 using a key derived from a SHA-256 hash of the key that is provided here. If no key is provided then an in-memory one will be generated, this will change on every restart though so it is not suitable for production environments. This must be more than 16 characters long for security reasons
-
soReusePort
@ConfigItem public boolean soReusePort
Enable socket reuse port (linux/macOs native transport only)
-
tcpQuickAck
@ConfigItem public boolean tcpQuickAck
Enable tcp quick ack (linux native transport only)
-
tcpCork
@ConfigItem public boolean tcpCork
Enable tcp cork (linux native transport only)
-
tcpFastOpen
@ConfigItem public boolean tcpFastOpen
Enable tcp fast open (linux native transport only)
-
domainSocket
@ConfigItem(defaultValue="/var/run/io.quarkus.app.socket") public String domainSocket
Path to a unix domain socket
-
domainSocketEnabled
@ConfigItem public boolean domainSocketEnabled
Enable listening to host:port
-
recordRequestStartTime
@ConfigItem public boolean recordRequestStartTime
If this is true then the request start time will be recorded to enable logging of total request time. This has a small performance penalty, so is disabled by default.
-
accessLog
AccessLogConfig accessLog
-
sameSiteCookie
@ConfigItem public Map<String,SameSiteCookieConfig> sameSiteCookie
Configuration that allows setting the same site attributes for cookies.
-
enableCompression
@ConfigItem public boolean enableCompression
If responses should be compressed. Note that this will attempt to compress all responses, to avoid compressing already compressed content (such as images) you need to set the following header: Content-Encoding: identity Which will tell vert.x not to compress the response.
-
enableDecompression
@ConfigItem public boolean enableDecompression
When enabled, vert.x will decompress the request's body if it's compressed. Note that the compression format (e.g., gzip) must be specified in the Content-Encoding header in the request.
-
unhandledErrorContentTypeDefault
@ConfigItem public Optional<HttpConfiguration.PayloadHint> unhandledErrorContentTypeDefault
Provides a hint (optional) for the default content type of responses generated for the errors not handled by the application.If the client requested a supported content-type in request headers (e.g. "Accept: application/json", "Accept: text/html"), Quarkus will use that content type.
Otherwise, it will default to the content type configured here.
-
header
@ConfigItem public Map<String,HeaderConfig> header
Additional HTTP Headers always sent in the response
-
proxy
public ProxyConfig proxy
-
-
Method Detail
-
determinePort
public int determinePort(LaunchMode launchMode)
-
determineSslPort
public int determineSslPort(LaunchMode launchMode)
-
-