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

pack-priv final Class NonSslRedirectDetector

extends ByteToMessageDecoder
Class Inheritance
Imports
io.netty5.buffer.Buffer, io.netty5.channel.ChannelHandlerContext, .ChannelPipeline, io.netty5.handler.codec.ByteToMessageDecoder, io.netty5.handler.ssl.SslHandler, reactor.netty5.NettyPipeline, reactor.netty5.tcp.SslProvider, javax.annotation.Nullable, java.net.SocketAddress

The handler detects if it's an SSL record header or an HTTP request from the first 5 bytes of the incoming message, and hands the message over to an SSL handler if it's an SSL record header or NonSslRedirectHandler if it's a potential HTTP request.
Author
James Chen
Since
1.0.5

Field Summary

Modifier and TypeField and Description
private final SocketAddress
private static final int
private final boolean
private final SslProvider
Inherited from io.netty5.handler.codec.ByteToMessageDecoder:
COMPOSITE_CUMULATORMERGE_CUMULATOR

Constructor Summary

AccessConstructor and Description
public
NonSslRedirectDetector(SslProvider sslProvider, SocketAddress remoteAddress, boolean sslDebug)

Method Summary

Modifier and TypeMethod and Description
protected void
decode(ChannelHandlerContext ctx, Buffer
the Buffer from which to read data
in
)

Implements abstract io.netty5.handler.codec.ByteToMessageDecoder.decode.

Decode the from one Buffer to another.
Inherited from io.netty5.handler.codec.ByteToMessageDecoder:
actualReadableByteschannelInactivechannelReadchannelReadCompletechannelShutdowndecodeLastdiscardSomeReadByteshandlerAddedhandlerAdded0handlerRemovedhandlerRemoved0internalBufferisSharableisSingleDecodesetSingleDecode

Field Detail

remoteAddressback to summary
private final SocketAddress remoteAddress
SSL_RECORD_HEADER_LENGTHback to summary
private static final int SSL_RECORD_HEADER_LENGTH
sslDebugback to summary
private final boolean sslDebug
sslProviderback to summary
private final SslProvider sslProvider

Constructor Detail

NonSslRedirectDetectorback to summary
public NonSslRedirectDetector(SslProvider sslProvider, SocketAddress remoteAddress, boolean sslDebug)

Method Detail

decodeback to summary
protected void decode(ChannelHandlerContext ctx, Buffer in)

Implements abstract io.netty5.handler.codec.ByteToMessageDecoder.decode.

Doc from io.netty5.handler.codec.ByteToMessageDecoder.decode.

Decode the from one Buffer to another. This method will be called till either the input Buffer has nothing to read when return from this method or till nothing was read from the input Buffer.

Parameters
ctx:ChannelHandlerContext

the ChannelHandlerContext which this ByteToMessageDecoder belongs to

in:Buffer

the Buffer from which to read data

Annotations
@Override