The following classes are available globally.
ChannelInboundHandlerthat parses HTTP/1-style messages, converting them from unstructured bytes to a sequence of HTTP messages.
HTTPDecoderis a generic channel handler which can produce messages in either the form of
HTTPServerRequestPart: that is, it produces messages that correspond to the semantic units of HTTP produced by the remote peer.
public final class HTTPDecoder<In, Out> : ByteToMessageDecoder, HTTPDecoderDelegate
ChannelHandlerthat handles HTTP pipelining by buffering inbound data until a response has been sent.
This handler ensures that HTTP server pipelines only process one request at a time. This is the safest way for pipelining-unaware code to operate, as it ensures that mutation of any shared server state is not parallelised, and that responses are always sent for each request in turn. In almost all cases this is the behaviour that a pipeline will want. This is achieved without doing too much buffering by preventing the
Channelfrom reading from the socket until a complete response is processed, ensuring that a malicious client is not capable of overwhelming a server by shoving an enormous amount of data down the
Channelwhile a server is processing a slow response.
See RFC 7320 Section 6.3.2 for more details on safely handling HTTP pipelining.
In addition to handling the request buffering, this
ChannelHandleris aware of TCP half-close. While there are very few HTTP clients that are capable of TCP half-close, clients that are not HTTP specific (e.g.
netcat) may trigger a TCP half-close. Having this
ChannelHandlerbe aware of TCP half-close makes it easier to build HTTP servers that are resilient to this kind of behaviour.
The TCP half-close handling is done by buffering the half-close notification along with the HTTP request parts. The half-close notification will be delivered in order with the rest of the reads. If the half-close occurs either before a request is received or during a request body upload, it will be delivered immediately. If a half-close is received immediately afterSee more
HTTPServerRequestPart.end, it will also be passed along immediately, allowing this signal to be seen by the HTTP server as early as possible.
public final class HTTPServerPipelineHandler : ChannelDuplexHandler, RemovableChannelHandler
A simple channel handler that catches errors emitted by parsing HTTP requests and sends 400 Bad Request responses.
This channel handler provides the basic behaviour that the majority of simple HTTP servers want. This handler does not suppress the parser errors: it allows them to continue to pass through the pipeline so that other handlers (e.g. logging ones) can deal with the error.See more
public final class HTTPServerProtocolErrorHandler : ChannelDuplexHandler, RemovableChannelHandler
A server-side channel handler that receives HTTP requests and optionally performs a HTTP-upgrade. Removes itself from the channel pipeline after the first inbound request on the connection, regardless of whether the upgrade succeeded or not.
This handler behaves a bit differently from its Netty counterpart because it does not allow upgrade on any request but the first on a connection. This is primarily to handle clients that pipeline: it’s sufficiently difficult to ensure that the upgrade happens at a safe time while dealing with pipelined requests that we choose to punt on it entirely and not allow it. As it happens this is mostly fine: the odds of someone needing to upgrade midway through the lifetime of a connection are very low.See more
public final class HTTPServerUpgradeHandler : ChannelInboundHandler, RemovableChannelHandler