HTTP listener
HTTP listeners can be configured on server level to avoid duplication of configuration on application/module level. Using server level HTTP configuration eliminates the need for globals/expansions to maintain a consistent HTTP listener configuration.
When using HTTP listener configuration, listeners are configured and started when the server starts, not inline when requested by modules. The only configuration needed by modules is to specify the name of listener.
Which listener a module uses is specified by property http_listener
(in the module configuration).
HTTP may also be disabled on server level causing all HTTP listener operations to fail. Use this only for configurations where inbound HTTP is not used/wanted.
enabled
Flag to disable http
true
listeners
List of HTTP listener objects. If non existing or empty, no listeners will be created (but may be created modules using inline configuration).
[]
Listener configuration
A listener represents a combination of host/ip and a port on the local machine. A listener can be used by one or more modules. Listener settings can not be changed or overridden by modules. If a module uses local HTTP configuration that equals an already existing listener, that listener will be used.
name
Logical name of listener
host
Host or IP to use
"0.0.0.0"
port
Port to use
8080
ssl
SSL/TLS configuration
options
Advanced listener options
redirect_url
Redirect here from context root
URL
allow_forward_headers
NONE, FORWARD, X_FORWARD, ALL
X_FORWARD
SSL/TLS configuration
enabled
Flag to enable SSL
false
keystore
Key store object.
key_alias
Alias specifying which key (in the key store) to use.
key_password
The key password
use_alpn
Flag to turn off ALPN and HTTP/2 support
true
truststore
Keystore object containing trusted entities.
client_auth
Flag to turn on SSL clientAuth. When enabled, all clients must present a valid certificate issued by a valid and trusted issuer available in the configured trust store.
false
ALPN and HTTP/2
ALPN (Application Layer Protocol Negotiation) is a TLS extension that negotiates the protocol before the client and the server start to exchange data. If APLN is enabled, the current listener uses SSL/TLS and if the client supports it, HTTP/2 (h2) will be used.
HTTP/2 requires SSL/TLS (h2). Unencrypted HTTP/2 (h2c) is NOT supported.
Advanced configuration
For advanced HTTP listener configuration the options
object may be used. This object translate to the VertX HttpServerOptions object. For more information, see VertX documentation.
Last updated