public final class HttpServerOptions extends ServerOptions
DEFAULT_PORT| Modifier and Type | Method and Description |
|---|---|
HttpServerOptions |
afterChannelInit(java.util.function.Consumer<? super Channel> afterChannelInit)
Setup the callback after each
Channel initialization and after
reactor-netty
pipeline handlers have been registered. |
<T> ServerOptions |
attr(AttributeKey<T> key,
T value)
Attribute default attribute to the future
Channel connection. |
HttpServerOptions |
channelGroup(ChannelGroup channelGroup)
Provide a
ChannelGroup for each active remote channel will be held in the
provided group. |
HttpServerOptions |
compression(boolean enabled)
Enable GZip response compression if the client request presents accept encoding
headers
|
HttpServerOptions |
compression(int minResponseSize)
Enable GZip response compression if the client request presents accept encoding
headers
AND the response reaches a minimum threshold
|
static HttpServerOptions |
create()
Create a new server builder
|
HttpServerOptions |
duplicate()
Return a copy of all options and references such as
NettyOptions.onChannelInit(Predicate). |
HttpServerOptions |
eventLoopGroup(EventLoopGroup eventLoopGroup)
Provide a shared
EventLoopGroup each Connector handler. |
HttpServerOptions |
listen(InetSocketAddress listenAddress)
The
InetSocketAddress on which this server should listen. |
HttpServerOptions |
listen(int port)
The port on which this server should listen, assuming it should bind to all available addresses.
|
HttpServerOptions |
listen(String host)
The host on which this server should listen, port will be resolved on bind.
|
HttpServerOptions |
listen(String host,
int port)
The host and port on which this server should listen.
|
HttpServerOptions |
loopResources(LoopResources eventLoopSelector)
Provide an
EventLoopGroup supplier. |
HttpServerOptions |
onChannelInit(java.util.function.Predicate<? super Channel> onChannelInit)
A callback for each
Channel initialization and before reactor-netty
pipeline handlers have been registered. |
<T> HttpServerOptions |
option(ChannelOption<T> key,
T value)
Set a
ChannelOption value for low level connection settings like
SO_TIMEOUT or SO_KEEPALIVE. |
HttpServerOptions |
preferNative(boolean preferNative)
Set the preferred native option.
|
<T> HttpServerOptions |
selectorAttr(AttributeKey<T> key,
T value)
Attribute default attribute to the future
Channel connection. |
<T> HttpServerOptions |
selectorOption(ChannelOption<T> key,
T value)
Set a
ChannelOption value for low level selector channel settings like
SO_TIMEOUT or SO_KEEPALIVE. |
HttpServerOptions |
sslCloseNotifyFlushTimeout(java.time.Duration sslCloseNotifyFlushTimeout)
Set the options to use for configuring SSL close_notify flush timeout.
|
HttpServerOptions |
sslCloseNotifyFlushTimeoutMillis(long sslCloseNotifyFlushTimeoutMillis)
Set the options to use for configuring SSL close_notify flush timeout.
|
HttpServerOptions |
sslCloseNotifyReadTimeout(java.time.Duration sslCloseNotifyReadTimeout)
Set the options to use for configuring SSL close_notify read timeout.
|
HttpServerOptions |
sslCloseNotifyReadTimeoutMillis(long sslCloseNotifyReadTimeoutMillis)
Set the options to use for configuring SSL close_notify read timeout.
|
HttpServerOptions |
sslContext(SslContext sslContext)
Set the options to use for configuring SSL.
|
HttpServerOptions |
sslHandshakeTimeout(java.time.Duration sslHandshakeTimeout)
Set the options to use for configuring SSL handshake timeout.
|
HttpServerOptions |
sslHandshakeTimeoutMillis(long sslHandshakeTimeoutMillis)
Set the options to use for configuring SSL handshake timeout.
|
HttpServerOptions |
sslSelfSigned()
Enable SSL service with a self-signed certificate
|
HttpServerOptions |
sslSelfSigned(java.util.function.Consumer<? super SslContextBuilder> configurator)
Enable SSL service with a self-signed certificate and allows extra
parameterization of the self signed
SslContextBuilder. |
get, getAddressafterChannelInit, defaultSslContext, getLoopResources, getSslHandler, onChannelInit, preferNative, toStringpublic static HttpServerOptions create()
public HttpServerOptions afterChannelInit(java.util.function.Consumer<? super Channel> afterChannelInit)
NettyOptionsChannel initialization and after
reactor-netty
pipeline handlers have been registered.afterChannelInit in class NettyOptions<ServerBootstrap,ServerOptions>afterChannelInit - the post channel setup handlerthisNettyOptions.onChannelInit(Predicate)public <T> ServerOptions attr(AttributeKey<T> key, T value)
ServerOptionsChannel connection. They will
be available via NettyInbound.attr(AttributeKey).attr in class ServerOptionsT - the attribute typekey - the attribute keyvalue - the attribute valueServerBootstrap.childAttr(AttributeKey, Object)public HttpServerOptions channelGroup(ChannelGroup channelGroup)
NettyOptionsChannelGroup for each active remote channel will be held in the
provided group.channelGroup in class NettyOptions<ServerBootstrap,ServerOptions>channelGroup - a ChannelGroup to monitor remote channelpublic HttpServerOptions loopResources(LoopResources eventLoopSelector)
NettyOptionsEventLoopGroup supplier.
Note that server might call it twice for both their selection and io loops.loopResources in class NettyOptions<ServerBootstrap,ServerOptions>eventLoopSelector - a selector accepting native runtime expectation and
returning an eventLoopGrouppublic HttpServerOptions duplicate()
NettyOptionsNettyOptions.onChannelInit(Predicate). Further option uses on the returned builder will
be fully isolated from this option builder.duplicate in class ServerOptionspublic HttpServerOptions eventLoopGroup(EventLoopGroup eventLoopGroup)
NettyOptionsEventLoopGroup each Connector handler.eventLoopGroup in class NettyOptions<ServerBootstrap,ServerOptions>eventLoopGroup - an eventLoopGroup to shareEventLoopGroup provider given the native runtime expectationpublic HttpServerOptions listen(String host, int port)
ServerOptionslisten in class ServerOptionshost - The host to bind to.port - The port to listen on.public HttpServerOptions listen(InetSocketAddress listenAddress)
ServerOptionsInetSocketAddress on which this server should listen.listen in class ServerOptionslistenAddress - the listen addresspublic HttpServerOptions listen(int port)
ServerOptionslisten in class ServerOptionsport - The port to listen on.public HttpServerOptions listen(String host)
ServerOptionslisten in class ServerOptionshost - The host to bind to.public HttpServerOptions onChannelInit(java.util.function.Predicate<? super Channel> onChannelInit)
NettyOptionsChannel initialization and before reactor-netty
pipeline handlers have been registered.onChannelInit in class NettyOptions<ServerBootstrap,ServerOptions>onChannelInit - pre channel pipeline setup handlerthisNettyOptions.afterChannelInit(Consumer)public <T> HttpServerOptions option(ChannelOption<T> key, T value)
ServerOptionsChannelOption value for low level connection settings like
SO_TIMEOUT or SO_KEEPALIVE. This will apply to each new channel from remote
peer.option in class ServerOptionsT - the option typekey - the option keythisServerBootstrap.childOption(ChannelOption, Object)public <T> HttpServerOptions selectorAttr(AttributeKey<T> key, T value)
ServerOptionsChannel connection. They will
be available via NettyInbound.attr(AttributeKey).selectorAttr in class ServerOptionsT - the attribute typekey - the attribute keyvalue - the attribute valueAbstractBootstrap.attr(AttributeKey, Object)public <T> HttpServerOptions selectorOption(ChannelOption<T> key, T value)
ServerOptionsChannelOption value for low level selector channel settings like
SO_TIMEOUT or SO_KEEPALIVE. This will apply to each new channel from remote
peer.selectorOption in class ServerOptionsT - the option typekey - the option keythisServerBootstrap.childOption(ChannelOption, Object)public HttpServerOptions preferNative(boolean preferNative)
NettyOptionspreferNative in class NettyOptions<ServerBootstrap,ServerOptions>preferNative - Should the connector prefer native (epoll) if availablethispublic HttpServerOptions sslContext(SslContext sslContext)
NettyOptionsnull means
don't use SSL at all (the default).sslContext in class NettyOptions<ServerBootstrap,ServerOptions>sslContext - The context to set when configuring SSLpublic HttpServerOptions sslHandshakeTimeout(java.time.Duration sslHandshakeTimeout)
NettyOptionssslHandshakeTimeout in class NettyOptions<ServerBootstrap,ServerOptions>sslHandshakeTimeout - The timeout Durationpublic HttpServerOptions sslHandshakeTimeoutMillis(long sslHandshakeTimeoutMillis)
NettyOptionssslHandshakeTimeoutMillis in class NettyOptions<ServerBootstrap,ServerOptions>sslHandshakeTimeoutMillis - The timeout in millisecondspublic HttpServerOptions sslCloseNotifyFlushTimeout(java.time.Duration sslCloseNotifyFlushTimeout)
NettyOptionssslCloseNotifyFlushTimeout in class NettyOptions<ServerBootstrap,ServerOptions>sslCloseNotifyFlushTimeout - The timeout Durationpublic HttpServerOptions sslCloseNotifyFlushTimeoutMillis(long sslCloseNotifyFlushTimeoutMillis)
NettyOptionssslCloseNotifyFlushTimeoutMillis in class NettyOptions<ServerBootstrap,ServerOptions>sslCloseNotifyFlushTimeoutMillis - The timeout in millisecondspublic HttpServerOptions sslCloseNotifyReadTimeout(java.time.Duration sslCloseNotifyReadTimeout)
NettyOptionssslCloseNotifyReadTimeout in class NettyOptions<ServerBootstrap,ServerOptions>sslCloseNotifyReadTimeout - The timeout Durationpublic HttpServerOptions sslCloseNotifyReadTimeoutMillis(long sslCloseNotifyReadTimeoutMillis)
NettyOptionssslCloseNotifyReadTimeoutMillis in class NettyOptions<ServerBootstrap,ServerOptions>sslCloseNotifyReadTimeoutMillis - The timeout in millisecondspublic HttpServerOptions sslSelfSigned(java.util.function.Consumer<? super SslContextBuilder> configurator)
ServerOptionsSslContextBuilder. The builder is
then used to invoke NettyOptions.sslContext(SslContext).sslSelfSigned in class ServerOptionsconfigurator - the builder callback to setup the self-signed SslContextBuilderthispublic HttpServerOptions sslSelfSigned()
ServerOptionssslSelfSigned in class ServerOptionsthispublic HttpServerOptions compression(boolean enabled)
enabled - true whether compression is enabledpublic HttpServerOptions compression(int minResponseSize)
minResponseSize - compression is performed once response size exceeds given
value in byte