Package reactor.netty.http.server
Class HttpServerConfig
java.lang.Object
reactor.netty.transport.TransportConfig
reactor.netty.transport.ServerTransportConfig<HttpServerConfig>
reactor.netty.http.server.HttpServerConfig
Encapsulate all necessary configuration for HTTP server transport. The public API is read-only.
- Author:
- Stephane Maldini, Violeta Georgieva, Andrey Shlykov
-
Method Summary
Modifier and TypeMethodDescriptionchannelInitializer(ConnectionObserver connectionObserver, @Nullable SocketAddress remoteAddress, boolean onServer) channelType(boolean isDomainSocket) @Nullable BiPredicate<HttpServerRequest,HttpServerResponse> Return the configured compression predicate or null.Deprecated.as of 1.1.0.Deprecated.as of 1.1.0.decoder()Return the configured HTTP request decoder options or the default.protected LoggingHandlerprotected LoopResourcesprotected ChannelMetricsRecorderprotected ChannelPipelineConfigurerReturn the configured HTTP form decoder or the default.@Nullable Http2SettingsSpecReturn the HTTP/2 configuration.@Nullable Http3SettingsSpecReturn the HTTP/3 configuration.@Nullable DurationReturn the configured idle timeout for the connection when it is waiting for an HTTP request or null.booleanReturns whether thatHttpServersupports the"Forwarded"and"X-Forwarded-*"HTTP request headers for deriving information about the connection.booleanisSecure()Returns true if thatHttpServersecured via SSL transport.protected voidloggingHandler(LoggingHandler loggingHandler) intThe configured maximum number of HTTP/1.1 requests which can be served until the connection is closed by the server.protected voidmetricsRecorder(@Nullable Supplier<? extends ChannelMetricsRecorder> metricsRecorder) intCompression is performed once response size exceeds the minimum compression size in bytes.Return the HTTP protocol to support.Return the supported type for the"HAProxy proxy protocol".@Nullable DurationReturn the configured read timeout for the request or null.booleanReturns true if thatHttpServerwill redirect HTTP to HTTPS by changing the scheme only but otherwise leaving the port the same when SSL is enabled.@Nullable DurationReturn the configured request timeout for the request or null.@Nullable SslProviderReturns the currentSslProviderif thatHttpServersecured via SSL transport or null.Returns the configured function that receives the actual uri and returns the uri tag value that will be used for the metrics withMetrics.URItag.Methods inherited from class reactor.netty.transport.ServerTransportConfig
childAttributes, childObserver, childOptions, defaultChildObserver, defaultConnectionObserver, doOnBind, doOnBound, doOnConnection, doOnUnbound, eventLoopGroupMethods inherited from class reactor.netty.transport.TransportConfig
attributes, bindAddress, bindAddress, channelGroup, channelHash, channelOperationsProvider, connectionFactory, connectionObserver, doOnChannelInit, isPreferNative, loggingHandler, loopResources, metricsRecorder, metricsRecorderInternal, options, updateMap
-
Method Details
-
compressPredicate
Return the configured compression predicate or null.- Returns:
- the configured compression predicate or null
-
cookieDecoder
Deprecated.as of 1.1.0. This will be removed in 2.0.0 as Netty 5 supports only strict validation.Return the configuredServerCookieDecoderor the defaultServerCookieDecoder.STRICT.- Returns:
- the configured
ServerCookieDecoderor the defaultServerCookieDecoder.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 configuredServerCookieEncoderor the defaultServerCookieEncoder.STRICT.- Returns:
- the configured
ServerCookieEncoderor the defaultServerCookieEncoder.STRICT
-
decoder
Return the configured HTTP request decoder options or the default.- Returns:
- the configured HTTP request decoder options or the default
-
formDecoderProvider
Return the configured HTTP form decoder or the default.- Returns:
- the configured HTTP form decoder or the default
- Since:
- 1.0.11
-
http2SettingsSpec
Return the HTTP/2 configuration.- Returns:
- the HTTP/2 configuration
-
http3SettingsSpec
Return the HTTP/3 configuration.- Returns:
- the HTTP/3 configuration
- Since:
- 1.2.0
-
idleTimeout
Return the configured idle timeout for the connection when it is waiting for an HTTP request or null.- Returns:
- the configured idle timeout for the connection when it is waiting for an HTTP request or null
-
isForwarded
public boolean isForwarded()Returns whether thatHttpServersupports the"Forwarded"and"X-Forwarded-*"HTTP request headers for deriving information about the connection.- Returns:
- true if that
HttpServersupports the"Forwarded"and"X-Forwarded-*"HTTP request headers for deriving information about the connection
-
isSecure
public boolean isSecure()Returns true if thatHttpServersecured via SSL transport.- Returns:
- true if that
HttpServersecured via SSL transport
-
maxKeepAliveRequests
public int maxKeepAliveRequests()The configured maximum number of HTTP/1.1 requests which can be served until the connection is closed by the server.- Returns:
- the configured maximum number of HTTP/1.1 requests which can be served until the connection is closed by the server.
- Since:
- 1.0.13
- See Also:
-
minCompressionSize
public int minCompressionSize()Compression is performed once response size exceeds the minimum compression size in bytes.- Returns:
- the minimum compression size in bytes
-
protocols
Return the HTTP protocol to support. Default isHttpProtocol.HTTP11.- Returns:
- the HTTP protocol to support
-
proxyProtocolSupportType
Return the supported type for the"HAProxy proxy protocol". The default isProxyProtocolSupportType.OFF.- Returns:
- the supported type for the
"HAProxy proxy protocol"
-
readTimeout
Return the configured read timeout for the request or null.- Returns:
- the configured read timeout for the request or null
- Since:
- 1.1.9
-
redirectHttpToHttps
public boolean redirectHttpToHttps()Returns true if thatHttpServerwill 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.- Returns:
- true if that
HttpServerwill 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.
-
requestTimeout
Return the configured request timeout for the request or null.- Returns:
- the configured request timeout for the request or null
- Since:
- 1.1.9
-
sslProvider
Returns the currentSslProviderif thatHttpServersecured via SSL transport or null.- Returns:
- the current
SslProviderif thatHttpServersecured via SSL transport or null
-
uriTagValue
Returns the configured function that receives the actual uri and returns the uri tag value that will be used for the metrics withMetrics.URItag.- Returns:
- the configured function that receives the actual uri and returns the uri tag value
that will be used for the metrics with
Metrics.URItag
-
channelInitializer
public ChannelInitializer<Channel> channelInitializer(ConnectionObserver connectionObserver, @Nullable SocketAddress remoteAddress, boolean onServer) - Overrides:
channelInitializerin classTransportConfig
-
channelType
- Overrides:
channelTypein classServerTransportConfig<HttpServerConfig>
-
defaultLoggingHandler
- Specified by:
defaultLoggingHandlerin classTransportConfig
-
defaultLoopResources
- Specified by:
defaultLoopResourcesin classTransportConfig
-
defaultMetricsRecorder
- Specified by:
defaultMetricsRecorderin classTransportConfig
-
defaultOnChannelInit
- Overrides:
defaultOnChannelInitin classServerTransportConfig<HttpServerConfig>
-
loggingHandler
- Overrides:
loggingHandlerin classTransportConfig
-
metricsRecorder
protected void metricsRecorder(@Nullable Supplier<? extends ChannelMetricsRecorder> metricsRecorder) - Overrides:
metricsRecorderin classTransportConfig
-