public final class HttpServerConfig extends ServerTransportConfig<HttpServerConfig>
Modifier and Type | Method and Description |
---|---|
BiPredicate<HttpServerRequest,HttpServerResponse> |
compressPredicate()
Return the configured compression predicate or null.
|
ServerCookieDecoder |
cookieDecoder()
Deprecated.
as of 1.1.0. This will be removed in 2.0.0 as Netty 5 supports only strict validation.
|
ServerCookieEncoder |
cookieEncoder()
Deprecated.
as of 1.1.0. This will be removed in 2.0.0 as Netty 5 supports only strict validation.
|
HttpRequestDecoderSpec |
decoder()
Return the configured HTTP request decoder options or the default.
|
protected LoggingHandler |
defaultLoggingHandler()
Return the default
LoggingHandler to wiretap this transport. |
protected LoopResources |
defaultLoopResources()
Return the default
LoopResources for this transport. |
protected ChannelMetricsRecorder |
defaultMetricsRecorder()
Return the configured metrics recorder.
|
protected ChannelPipelineConfigurer |
defaultOnChannelInit()
Return the default callback if any or
ChannelPipelineConfigurer.emptyConfigurer() . |
HttpServerFormDecoderProvider |
formDecoderProvider()
Return the configured HTTP form decoder or the default.
|
Http2SettingsSpec |
http2SettingsSpec()
Return the HTTP/2 configuration.
|
Duration |
idleTimeout()
Return the configured idle timeout for the connection when it is waiting for an HTTP request or null.
|
boolean |
isForwarded()
Returns whether that
HttpServer supports the "Forwarded" and "X-Forwarded-*"
HTTP request headers for deriving information about the connection. |
boolean |
isSecure()
Returns true if that
HttpServer secured via SSL transport. |
protected void |
loggingHandler(LoggingHandler loggingHandler) |
int |
maxKeepAliveRequests()
The configured maximum number of HTTP/1.1 requests which can be served until the connection is closed by the server.
|
protected void |
metricsRecorder(Supplier<? extends ChannelMetricsRecorder> metricsRecorder)
Obtains immediately the
ChannelMetricsRecorder from the provided Supplier . |
int |
minCompressionSize()
Compression is performed once response size exceeds the minimum compression size in bytes.
|
HttpProtocol[] |
protocols()
Return the HTTP protocol to support.
|
ProxyProtocolSupportType |
proxyProtocolSupportType()
Return the supported type for the
"HAProxy proxy protocol" . |
Duration |
readTimeout()
Return the configured read timeout for the request or null.
|
boolean |
redirectHttpToHttps()
Returns true if that
HttpServer will redirect HTTP to HTTPS by changing
the scheme only but otherwise leaving the port the same when SSL is enabled. |
Duration |
requestTimeout()
Return the configured request timeout for the request or null.
|
SslProvider |
sslProvider()
Returns the current
SslProvider if that HttpServer secured via SSL
transport or null. |
Function<String,String> |
uriTagValue()
Returns the configured function that receives the actual uri and returns the uri tag value
that will be used for the metrics with
Metrics.URI tag. |
channelType, childAttributes, childObserver, childOptions, defaultChildObserver, defaultConnectionObserver, doOnBind, doOnBound, doOnConnection, doOnUnbound, eventLoopGroup
attributes, bindAddress, channelGroup, channelHash, channelInitializer, channelOperationsProvider, connectionFactory, connectionObserver, doOnChannelInit, isPreferNative, loggingHandler, loopResources, metricsRecorder, metricsRecorderInternal, options, updateMap
@Nullable public BiPredicate<HttpServerRequest,HttpServerResponse> compressPredicate()
@Deprecated public ServerCookieDecoder cookieDecoder()
ServerCookieDecoder
or the default ServerCookieDecoder.STRICT
.ServerCookieDecoder
or the default ServerCookieDecoder.STRICT
@Deprecated public ServerCookieEncoder cookieEncoder()
ServerCookieEncoder
or the default ServerCookieEncoder.STRICT
.ServerCookieEncoder
or the default ServerCookieEncoder.STRICT
public HttpRequestDecoderSpec decoder()
public HttpServerFormDecoderProvider formDecoderProvider()
public Http2SettingsSpec http2SettingsSpec()
@Nullable public Duration idleTimeout()
public boolean isForwarded()
HttpServer
supports the "Forwarded"
and "X-Forwarded-*"
HTTP request headers for deriving information about the connection.HttpServer
supports the "Forwarded"
and "X-Forwarded-*"
HTTP request headers for deriving information about the connectionpublic boolean isSecure()
HttpServer
secured via SSL transport.HttpServer
secured via SSL transportpublic int maxKeepAliveRequests()
HttpServer.maxKeepAliveRequests(int)
public int minCompressionSize()
public HttpProtocol[] protocols()
HttpProtocol.HTTP11
.public ProxyProtocolSupportType proxyProtocolSupportType()
"HAProxy proxy protocol"
.
The default is ProxyProtocolSupportType.OFF
."HAProxy proxy protocol"
@Nullable public Duration readTimeout()
public boolean redirectHttpToHttps()
HttpServer
will redirect HTTP to HTTPS by changing
the scheme only but otherwise leaving the port the same when SSL is enabled.
This configuration is applicable only for HTTP/1.x.HttpServer
will redirect HTTP to HTTPS by changing
the scheme only but otherwise leaving the port the same when SSL is enabled.
This configuration is applicable only for HTTP/1.x.@Nullable public Duration requestTimeout()
@Nullable public SslProvider sslProvider()
SslProvider
if that HttpServer
secured via SSL
transport or null.SslProvider
if that HttpServer
secured via SSL
transport or null@Nullable public Function<String,String> uriTagValue()
Metrics.URI
tag.Metrics.URI
tagprotected LoggingHandler defaultLoggingHandler()
TransportConfig
LoggingHandler
to wiretap this transport.defaultLoggingHandler
in class TransportConfig
LoggingHandler
to wiretap this transportprotected LoopResources defaultLoopResources()
TransportConfig
LoopResources
for this transport.defaultLoopResources
in class TransportConfig
LoopResources
for this transportprotected ChannelMetricsRecorder defaultMetricsRecorder()
TransportConfig
defaultMetricsRecorder
in class TransportConfig
protected ChannelPipelineConfigurer defaultOnChannelInit()
TransportConfig
ChannelPipelineConfigurer.emptyConfigurer()
.defaultOnChannelInit
in class ServerTransportConfig<HttpServerConfig>
ChannelPipelineConfigurer.emptyConfigurer()
protected void loggingHandler(LoggingHandler loggingHandler)
loggingHandler
in class TransportConfig
protected void metricsRecorder(@Nullable Supplier<? extends ChannelMetricsRecorder> metricsRecorder)
TransportConfig
ChannelMetricsRecorder
from the provided Supplier
.metricsRecorder
in class TransportConfig
metricsRecorder
- a supplier for the ChannelMetricsRecorder