bind() is ultimately called.
Examples:
HttpServer.create()
.host("0.0.0.0")
.handle((req, res) -> res.sendString(Flux.just("hello")))
.bind()
.block();
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final Logger |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final HttpServer | Returns: a newHttpServerenable or disable the access log enable)Enable or disable the access log. |
| public final HttpServer | Returns: a newHttpServerenable or disable the access log enable, AccessLogFactory accessLogFactory)Enable or disable the access log and customize it through an |
| public final HttpServer | Returns: a newHttpServer
Deprecated
as of 1.0.3.
Customize the access log, provided access logging has been enabled through the
reactor.netty.http.server.accessLogEnabled system property.
|
| public final HttpServer | bindAddress(Supplier<? extends SocketAddress>
A supplier of the address to bind to. bindAddressSupplier)
Set a new local address to which this transport should bind on subscribe.
|
| public final HttpServer | channelGroup(ChannelGroup channelGroup)
Overrides reactor. ChannelGroup to hold all active connected channels.
|
| public final HttpServer | Returns: a newHttpServerthat returns true to compress the response. predicate)Enable GZip response compression if the client request presents accept encoding
headers and the provided |
| public final HttpServer | Returns: a newHttpServerif true GZip response compression
is enabled if the client request presents accept encoding, otherwise disabled. compressionEnabled)Specifies whether GZip response compression is enabled if the client request presents accept encoding. |
| public final HttpServer | Returns: a newHttpServercompression is performed once response size exceeds the given
value in bytes minResponseSize)Enable GZip response compression if the client request presents accept encoding headers AND the response reaches a minimum threshold. |
| public final HttpServer | Returns: a newHttpServerthe preferred ServerCookieEncoder encoder)
Deprecated
as of 1.1.0. This will be removed in 2.0.0 as Netty 5 supports only strict validation.
Configure the
ServerCookieEncoder; ServerCookieDecoder will be
chosen based on the encoder.
|
| public final HttpServer | Returns: a newHttpServerthe preferred ServerCookieEncoder encoder, ServerCookieDecoder the preferred ServerCookieDecoder decoder)
Deprecated
as of 1.1.0. This will be removed in 2.0.0 as Netty 5 supports only strict validation.
Configure the
ServerCookieEncoder and ServerCookieDecoder.
|
| public static HttpServer | |
| public final HttpServer | Returns: a newHttpServerthe forwarded header handler handler)Specifies a custom request handler for deriving information about the connection. |
| public final HttpServer | Returns: a newHttpServerif true support for the forwardedEnabled)"Forwarded" and "X-Forwarded-*"
HTTP request headers for deriving information about the connection is enabled,
otherwise disabled.Specifies whether support for the |
| public static HttpServer | Returns: a newHttpServer
Deprecated
Use the other methods exposed by
Prepare an HttpServer to achieve the same configurations.
This method will be removed in version 1.1.0.
HttpServerNote There isn't only one method that replaces this deprecated method. |
| public final HttpServer | Returns: a newHttpServeran I/O handler that can dispose underlying connection when handler)Publisher terminates. Only the first registered handler will subscribe to the
returned Publisher while other will immediately cancel given a same
ConnectionAttach an I/O handler to react on a connected client. |
| public final HttpServer | host(String
the host to bind to. host)Overrides reactor. |
| public final HttpServer | Returns: a newHttpServerconfigures http2SettingsHttp2SettingsSpec before requestingApply HTTP/2 configuration. |
| public final HttpServer | Returns: a newHttpServerHttpServerFormDecoderProvider. for HTTP form decoder configurationApply HTTP form decoder configuration. |
| public final HttpServer | Returns: a newHttpServerthe factory for generating the log message httpMessageLogFactory)When |
| public final HttpServer | Returns: a newHttpServera function to mutate the provided Http request decoder options requestDecoderOptions)Configure the |
| public final HttpServer | Returns: a newHttpServeran idle timeout on the connection when it is waiting for an HTTP request (resolution: ms) idleTimeout)Specifies an idle timeout on the connection when it is waiting for an HTTP request (resolution: ms). |
| public final HttpServer | Returns: a newHttpServerA mapHandle)BiFunction to decorate the configured I/O handlerDecorate the configured I/O handler. |
| public final HttpServer | Returns: a newHttpServerthe maximum number of HTTP/1.1 requests which can be served until
the connection is closed by the server maxKeepAliveRequests)The maximum number of HTTP/1.1 requests which can be served until the connection is closed by the server. |
| public final HttpServer | Returns: a newHttpServertrue enables metrics collection; false disables it enable, Function<String, String> a function that receives the actual uri and returns the uri tag value
that will be used for the metrics with uriTagValue)reactor. tagWhether to enable metrics to be collected and registered in Micrometer's
|
| public final HttpServer | Returns: a newHttpServertrue enables metrics collection; false disables it enable, Function<String, String> a function that receives the actual uri and returns the uri tag value
that will be used for the metrics with uriTagValue, Function<String, String> reactor. taga function that receives the actual method name and returns the method tag value
that will be used for the metrics with methodTagValue)reactor. tagWhether to enable metrics to be collected and registered in Micrometer's
|
| public final HttpServer | metrics(boolean
if true enables the metrics on the enable, Supplier<? extends ChannelMetricsRecorder> Transport.a supplier for the recorder)ChannelMetricsRecorderOverrides reactor. Transport.
|
| public final HttpServer | Returns: a newHttpServertrue enables metrics collection; false disables it enable, Supplier<? extends ChannelMetricsRecorder> a supplier for the metrics recorder that receives the collected metrics recorder, Function<String, String> a function that receives the actual uri and returns the uri value
that will be used when the metrics are propagated to the recorder. uriValue)Specifies whether the metrics are enabled on the |
| public final HttpServer | Returns: a newHttpServertrue enables metrics collection; false disables it enable, Supplier<? extends ChannelMetricsRecorder> a supplier for the metrics recorder that receives the collected metrics recorder, Function<String, String> a function that receives the actual uri and returns the uri value
that will be used when the metrics are propagated to the recorder. uriValue, Function<String, String> a function that receives the actual method name and returns the method value
that will be used when the metrics are propagated to the recorder. methodValue)Specifies whether the metrics are enabled on the |
| public final HttpServer | |
| public final HttpServer | port(int
The port to bind to. port)Overrides reactor. |
| public final HttpServer | Returns: a newHttpServerThe various supportedProtocols)HttpProtocol this server will supportThe HTTP protocol to support. |
| public final HttpServer | Returns: a newHttpServer
Specifies whether support for the |
| public final HttpServer | Returns: a newHttpServerthe maximum duration allowed between each network-level read operation while reading a given
request content (resolution: ms) readTimeout)Specifies the maximum duration allowed between each network-level read operation while reading a given request content (resolution: ms). |
| public final HttpServer | Returns: a newHttpServerthe maximum duration for reading a given request content (resolution: ms) requestTimeout)Specifies the maximum duration for reading a given request content (resolution: ms). |
| public final HttpServer | Returns: a newHttpServer starting the router on subscribeprovides a route builder to be mutated in order to define routes. routesBuilder)Define routes for the server through the provided |
| public final HttpServer | Returns: a newHttpServerbuilder callback for further customization of SslContext. sslProviderBuilder)Apply an SSL configuration customization via the passed builder. |
| public final HttpServer | Returns: a newHttpServerbuilder callback for further customization of SslContext. sslProviderBuilder, boolean true enables redirecting HTTP to HTTPS by changing the
scheme only but otherwise leaving the port the same.
This configuration is applicable only for HTTP 1.x. redirectHttpToHttps)Apply an SSL configuration customization via the passed builder. |
| public final HttpServer | Returns: a newHttpServerThe provider to set when configuring SSL sslProvider)Applies an SSL configuration via the passed |
| public final HttpServer | Returns: a newHttpServerThe provider to set when configuring SSL sslProvider, boolean true enables redirecting HTTP to HTTPS by changing the
scheme only but otherwise leaving the port the same.
This configuration is applicable only for HTTP 1.x. redirectHttpToHttps)Applies an SSL configuration via the passed |
| public final HttpServer | Returns: a newHttpServerA tcpMapper)TcpServer mapping function to update TCP configuration and
return an enriched HttpServer to use.
Deprecated
Use the other methods exposed by
Apply a HttpServer to achieve the same configurations.
This method will be removed in version 1.1.0.
TcpServer mapping function to update TCP configuration and
return an enriched HttpServer to use.
|
| public Mono | Returns: aMono representing the completion of the warmupOverrides reactor. Mono that triggers:
|
| public final HttpServer | wiretap(boolean
specifies whether the wire logger configuration will be added to the pipeline enable)Overrides reactor. Transport category (logger),
DEBUG logger level and AdvancedByteBufFormat#HEX_DUMP for ByteBuf format,
which means both events and content will be logged and the content will be in hex format.
|