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

public final Class HttpServerConfig

extends ServerTransportConfig<HttpServerConfig>
Class Inheritance
Imports
io.netty5.channel.Channel, .ChannelHandler, .ChannelHandlerAdapter, .ChannelHandlerContext, .ChannelInitializer, .ChannelOption, .ChannelPipeline, io.netty.contrib.handler.codec.haproxy.HAProxyMessageDecoder, io.netty5.handler.codec.http.DefaultHttpContent, .HttpHeaderNames, .HttpRequest, .HttpServerCodec, .HttpServerUpgradeHandler, io.netty5.handler.codec.http2.CleartextHttp2ServerUpgradeHandler, .Http2CodecUtil, .Http2FrameCodec, .Http2FrameCodecBuilder, .Http2FrameLogger, .Http2MultiplexHandler, .Http2ServerUpgradeCodec, .Http2Settings, .Http2StreamFrameToHttpObjectCodec, io.netty5.handler.logging.LogLevel, .LoggingHandler, io.netty5.handler.ssl.ApplicationProtocolNames, .ApplicationProtocolNegotiationHandler, io.netty5.util.AsciiString, io.netty5.util.concurrent.Future, reactor.core.publisher.Mono, reactor.netty5.ChannelPipelineConfigurer, .Connection, .ConnectionObserver, .NettyPipeline, .ReactorNetty, reactor.netty5.channel.AbstractChannelMetricsHandler, .ChannelMetricsRecorder, .ChannelOperations, reactor.netty5.http.Http2SettingsSpec, .HttpProtocol, .HttpResources, reactor.netty5.http.logging.HttpMessageLogFactory, .ReactorNettyHttpMessageLogFactory, reactor.netty5.http.server.logging.AccessLog, .AccessLogArgProvider, .AccessLogHandlerFactory, reactor.netty5.resources.LoopResources, reactor.netty5.tcp.SslProvider, reactor.netty5.transport.ServerTransportConfig, reactor.netty5.transport.logging.AdvancedBufferFormat, reactor.util.Logger, .Loggers, reactor.util.annotation.Nullable, java.net.SocketAddress, java.nio.charset.Charset, java.time.Duration, java.util.Map, 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

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 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 int
pack-priv HttpProtocol[]
pack-priv ProxyProtocolSupportType
pack-priv boolean
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, HttpServerFormDecoderProvider formDecoderProvider, BiFunction<ConnectionInfo, HttpRequest, ConnectionInfo> forwardedHeaderHandler, HttpMessageLogFactory httpMessageLogFactory, ConnectionObserver listener, BiFunction<? super Mono<Void>, ? super Connection, ? extends Mono<Void>> mapHandle, ChannelMetricsRecorder metricsRecorder, int minCompressionSize, ChannelOperations.OnSetup opsFactory, 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, HttpServerFormDecoderProvider formDecoderProvider, BiFunction<ConnectionInfo, HttpRequest, ConnectionInfo> forwardedHeaderHandler, Http2Settings http2Settings, HttpMessageLogFactory httpMessageLogFactory, Duration idleTimeout, ConnectionObserver listener, BiFunction<? super Mono<Void>, ? super Connection, ? extends Mono<Void>> mapHandle, ChannelMetricsRecorder metricsRecorder, int minCompressionSize, ChannelOperations.OnSetup opsFactory, Function<String, String> uriTagValue, boolean validate)

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

pack-priv static void
configureHttp11Pipeline(ChannelPipeline p, boolean accessLogEnabled, Function<AccessLogArgProvider, AccessLog> accessLog, BiPredicate<HttpServerRequest, HttpServerResponse> compressPredicate, 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, ChannelMetricsRecorder metricsRecorder, int minCompressionSize, Function<String, String> uriTagValue)

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.netty5.transport.TransportConfig.defaultLoggingHandler.

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

Implements abstract reactor.netty5.transport.TransportConfig.defaultLoopResources.

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

Implements abstract reactor.netty5.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 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.netty5.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 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 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.netty5.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.netty5.Metrics#URI tag

Inherited from reactor.netty5.transport.ServerTransportConfig:
channelTypechildAttributeschildObserverchildOptionsconnectionFactorydefaultChildObserverdefaultConnectionObserverdoOnBinddoOnBounddoOnConnectiondoOnUnboundeventLoopGroup