Top Description Inners Fields Constructors Methods
reactor.netty.http.server

public final Class HttpServerConfig

extends ServerTransportConfig<HttpServerConfig>
Class Inheritance
Imports
io.netty.channel.Channel, .ChannelHandler, .ChannelHandlerAdapter, .ChannelHandlerContext, .ChannelInitializer, .ChannelOption, .ChannelPipeline, .ChannelPromise, io.netty.handler.codec.haproxy.HAProxyMessageDecoder, io.netty.handler.codec.http.HttpHeaderNames, .HttpObject, .HttpRequest, .HttpServerCodec, .HttpServerUpgradeHandler, io.netty.handler.codec.http.cookie.ServerCookieDecoder, .ServerCookieEncoder, io.netty.handler.codec.http2.CleartextHttp2ServerUpgradeHandler, .Http2CodecUtil, .Http2ConnectionAdapter, .Http2FrameCodec, .Http2FrameCodecBuilder, .Http2FrameLogger, .Http2MultiplexHandler, .Http2ServerUpgradeCodec, .Http2Settings, .Http2Stream, .Http2StreamFrameToHttpObjectCodec, io.netty.handler.logging.LogLevel, .LoggingHandler, io.netty.handler.ssl.ApplicationProtocolNames, .ApplicationProtocolNegotiationHandler, io.netty.handler.timeout.ReadTimeoutHandler, io.netty.util.AsciiString, reactor.core.publisher.Mono, reactor.netty.ChannelPipelineConfigurer, .Connection, .ConnectionObserver, .NettyPipeline, .ReactorNetty, reactor.netty.channel.AbstractChannelMetricsHandler, .ChannelMetricsRecorder, .ChannelOperations, reactor.netty.http.Http2SettingsSpec, .HttpProtocol, .HttpResources, reactor.netty.http.logging.HttpMessageLogFactory, .ReactorNettyHttpMessageLogFactory, reactor.netty.http.server.logging.AccessLog, .AccessLogArgProvider, .AccessLogHandlerFactory, reactor.netty.resources.LoopResources, reactor.netty.tcp.SslProvider, reactor.netty.transport.ServerTransportConfig, reactor.netty.transport.logging.AdvancedByteBufFormat, reactor.util.Logger, .Loggers, reactor.util.annotation.Nullable, java.net.SocketAddress, java.nio.charset.Charset, java.time.Duration, java.util.List, .Map, java.util.concurrent.Future, .TimeUnit, java.util.function.BiFunction, .BiPredicate, .Function, .Supplier

Encapsulate all necessary configuration for HTTP server transport. The public API is read-only.
Authors
Stephane Maldini, Violeta Georgieva, Andrey Shlykov

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv static final boolean
pack-priv Function<AccessLogArgProvider, AccessLog>
pack-priv boolean
pack-priv BiPredicate<HttpServerRequest, HttpServerResponse>
pack-priv ServerCookieDecoder
pack-priv ServerCookieEncoder
pack-priv HttpRequestDecoderSpec
pack-priv HttpServerFormDecoderProvider
pack-priv BiFunction<ConnectionInfo, HttpRequest, ConnectionInfo>
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final Http2StreamFrameToHttpObjectCodec
pack-priv Http2SettingsSpec
pack-priv HttpMessageLogFactory
pack-priv Duration
pack-priv static final Logger
pack-priv static final LoggingHandler
pack-priv BiFunction<? super Mono<Void>, ? super Connection, ? extends Mono<Void>>
pack-priv int
pack-priv Function<String, String>
pack-priv int
pack-priv HttpProtocol[]
pack-priv ProxyProtocolSupportType
pack-priv Duration
pack-priv boolean
pack-priv Duration
pack-priv static final boolean
SSL_DEBUG

Default value whether the SSL debugging on the server side will be enabled/disabled, fallback to SSL debugging disabled.

pack-priv SslProvider
pack-priv Function<String, String>

Constructor Summary

AccessConstructor and Description
pack-priv
HttpServerConfig(Map<ChannelOption<?>, ?> options, Map<ChannelOption<?>, ?> childOptions, Supplier<? extends SocketAddress> localAddress)

pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static void
addStreamHandlers(Channel ch, boolean accessLogEnabled, Function<AccessLogArgProvider, AccessLog> accessLog, BiPredicate<HttpServerRequest, HttpServerResponse> compressPredicate, ServerCookieDecoder decoder, ServerCookieEncoder encoder, HttpServerFormDecoderProvider formDecoderProvider, BiFunction<ConnectionInfo, HttpRequest, ConnectionInfo> forwardedHeaderHandler, HttpMessageLogFactory httpMessageLogFactory, ConnectionObserver listener, BiFunction<? super Mono<Void>, ? super Connection, ? extends Mono<Void>> mapHandle, Function<String, String> methodTagValue, ChannelMetricsRecorder metricsRecorder, int minCompressionSize, ChannelOperations.OnSetup opsFactory, Duration readTimeout, Duration requestTimeout, Function<String, String> uriTagValue)

public BiPredicate<HttpServerRequest, HttpServerResponse>

Returns:

the configured compression predicate or null
compressPredicate
()

Return the configured compression predicate or null.

pack-priv static BiPredicate<HttpServerRequest, HttpServerResponse>
compressPredicate(BiPredicate<HttpServerRequest, HttpServerResponse> compressionPredicate, int minResponseSize)

pack-priv static void
configureH2Pipeline(ChannelPipeline p, boolean accessLogEnabled, Function<AccessLogArgProvider, AccessLog> accessLog, BiPredicate<HttpServerRequest, HttpServerResponse> compressPredicate, ServerCookieDecoder cookieDecoder, ServerCookieEncoder cookieEncoder, boolean enableGracefulShutdown, HttpServerFormDecoderProvider formDecoderProvider, BiFunction<ConnectionInfo, HttpRequest, ConnectionInfo> forwardedHeaderHandler, Http2SettingsSpec http2SettingsSpec, HttpMessageLogFactory httpMessageLogFactory, Duration idleTimeout, ConnectionObserver listener, BiFunction<? super Mono<Void>, ? super Connection, ? extends Mono<Void>> mapHandle, Function<String, String> methodTagValue, ChannelMetricsRecorder metricsRecorder, int minCompressionSize, ChannelOperations.OnSetup opsFactory, Duration readTimeout, Duration requestTimeout, Function<String, String> uriTagValue, boolean validate)

pack-priv static void
configureHttp11OrH2CleartextPipeline(ChannelPipeline p, boolean accessLogEnabled, Function<AccessLogArgProvider, AccessLog> accessLog, BiPredicate<HttpServerRequest, HttpServerResponse> compressPredicate, ServerCookieDecoder cookieDecoder, ServerCookieEncoder cookieEncoder, HttpRequestDecoderSpec decoder, boolean enableGracefulShutdown, HttpServerFormDecoderProvider formDecoderProvider, BiFunction<ConnectionInfo, HttpRequest, ConnectionInfo> forwardedHeaderHandler, Http2SettingsSpec http2SettingsSpec, HttpMessageLogFactory httpMessageLogFactory, Duration idleTimeout, ConnectionObserver listener, BiFunction<? super Mono<Void>, ? super Connection, ? extends Mono<Void>> mapHandle, int maxKeepAliveRequests, Function<String, String> methodTagValue, ChannelMetricsRecorder metricsRecorder, int minCompressionSize, ChannelOperations.OnSetup opsFactory, Duration readTimeout, Duration requestTimeout, Function<String, String> uriTagValue)

pack-priv static void
configureHttp11Pipeline(ChannelPipeline p, boolean accessLogEnabled, Function<AccessLogArgProvider, AccessLog> accessLog, BiPredicate<HttpServerRequest, HttpServerResponse> compressPredicate, ServerCookieDecoder cookieDecoder, ServerCookieEncoder cookieEncoder, boolean channelOpened, HttpRequestDecoderSpec decoder, HttpServerFormDecoderProvider formDecoderProvider, BiFunction<ConnectionInfo, HttpRequest, ConnectionInfo> forwardedHeaderHandler, HttpMessageLogFactory httpMessageLogFactory, Duration idleTimeout, ConnectionObserver listener, BiFunction<? super Mono<Void>, ? super Connection, ? extends Mono<Void>> mapHandle, int maxKeepAliveRequests, Function<String, String> methodTagValue, ChannelMetricsRecorder metricsRecorder, int minCompressionSize, Duration readTimeout, Duration requestTimeout, Function<String, String> uriTagValue)

public ServerCookieDecoder

Returns:

the configured ServerCookieDecoder or the default ServerCookieDecoder#STRICT
cookieDecoder
()

Deprecated as of 1.1.0. This will be removed in 2.0.0 as Netty 5 supports only strict validation.
Return the configured ServerCookieDecoder or the default ServerCookieDecoder#STRICT.
public ServerCookieEncoder

Returns:

the configured ServerCookieEncoder or the default ServerCookieEncoder#STRICT
cookieEncoder
()

Deprecated as of 1.1.0. This will be removed in 2.0.0 as Netty 5 supports only strict validation.
Return the configured ServerCookieEncoder or the default ServerCookieEncoder#STRICT.
public HttpRequestDecoderSpec

Returns:

the configured HTTP request decoder options or the default
decoder
()

Return the configured HTTP request decoder options or the default.

protected LoggingHandler
defaultLoggingHandler()

Implements abstract reactor.netty.transport.TransportConfig.defaultLoggingHandler.

Return the default LoggingHandler to wiretap this transport.
protected LoopResources
defaultLoopResources()

Implements abstract reactor.netty.transport.TransportConfig.defaultLoopResources.

Return the default LoopResources for this transport.
protected ChannelMetricsRecorder
defaultMetricsRecorder()

Implements abstract reactor.netty.transport.TransportConfig.defaultMetricsRecorder.

Return the configured metrics recorder.
protected ChannelPipelineConfigurer
public HttpServerFormDecoderProvider

Returns:

the configured HTTP form decoder or the default
formDecoderProvider
()

Return the configured HTTP form decoder or the default.

pack-priv static Http2Settings
public Http2SettingsSpec

Returns:

the HTTP/2 configuration
http2SettingsSpec
()

Return the HTTP/2 configuration.

public Duration

Returns:

the configured idle timeout for the connection when it is waiting for an HTTP request or null
idleTimeout
()

Return the configured idle timeout for the connection when it is waiting for an HTTP request or null.

public boolean

Returns:

true if that HttpServer supports the "Forwarded" and "X-Forwarded-*" HTTP request headers for deriving information about the connection
isForwarded
()

Returns whether that HttpServer supports the "Forwarded" and "X-Forwarded-*" HTTP request headers for deriving information about the connection.

public boolean

Returns:

true if that HttpServer secured via SSL transport
isSecure
()

Returns true if that HttpServer secured via SSL transport.

protected void
public int

Returns:

the configured maximum number of HTTP/1.1 requests which can be served until the connection is closed by the server.
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>
a supplier for the ChannelMetricsRecorder
metricsRecorder
)

Overrides reactor.netty.transport.TransportConfig.metricsRecorder.

Obtains immediately the ChannelMetricsRecorder from the provided Supplier.
public int

Returns:

the minimum compression size in bytes
minCompressionSize
()

Compression is performed once response size exceeds the minimum compression size in bytes.

public HttpProtocol[]

Returns:

the HTTP protocol to support
protocols
()

Return the HTTP protocol to support.

pack-priv void
protocols(HttpProtocol... protocols)

public ProxyProtocolSupportType

Returns:

the supported type for the "HAProxy proxy protocol"
proxyProtocolSupportType
()

Return the supported type for the "HAProxy proxy protocol".

public Duration

Returns:

the configured read timeout for the request or null
readTimeout
()

Return the configured read timeout for the request or null.

public boolean

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. This configuration is applicable only for HTTP/1.x.
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.

public Duration

Returns:

the configured request timeout for the request or null
requestTimeout
()

Return the configured request timeout for the request or null.

public SslProvider

Returns:

the current SslProvider if that HttpServer secured via SSL transport or null
sslProvider
()

Returns the current SslProvider if that HttpServer secured via SSL transport or null.

public Function<String, String>

Returns:

the configured function that receives the actual uri and returns the uri tag value that will be used for the metrics with reactor.netty.Metrics#URI tag
uriTagValue
()

Returns the configured function that receives the actual uri and returns the uri tag value that will be used for the metrics with reactor.netty.Metrics#URI tag.

Inherited from reactor.netty.transport.ServerTransportConfig:
channelTypechildAttributeschildObserverchildOptionsdefaultChildObserverdefaultConnectionObserverdoOnBinddoOnBounddoOnConnectiondoOnUnboundeventLoopGroup