public class HAProxyMessageDecoder
extends io.netty.handler.codec.ByteToMessageDecoder
| Constructor and Description |
|---|
HAProxyMessageDecoder()
Creates a new decoder with no additional data (TLV) restrictions, and should throw an exception as soon as
we exceed maxLength.
|
HAProxyMessageDecoder(boolean failFast)
Creates a new decoder with no additional data (TLV) restrictions, whether or not to throw an exception as soon
as we exceed maxLength.
|
HAProxyMessageDecoder(int maxTlvSize)
Creates a new decoder with restricted additional data (TLV) size, and should throw an exception as soon as
we exceed maxLength.
|
HAProxyMessageDecoder(int maxTlvSize,
boolean failFast)
Creates a new decoder with restricted additional data (TLV) size, whether or not to throw an exception as soon
as we exceed maxLength.
|
| Modifier and Type | Method and Description |
|---|---|
void |
channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg) |
protected void |
decode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf in,
List<Object> out) |
static io.netty.handler.codec.ProtocolDetectionResult<HAProxyProtocolVersion> |
detectProtocol(io.netty.buffer.ByteBuf buffer)
Returns the
ProtocolDetectionResult for the given ByteBuf. |
boolean |
isSingleDecode() |
actualReadableBytes, callDecode, channelInactive, channelReadComplete, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggeredchannelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaughtensureNotSharable, handlerAdded, isSharablepublic HAProxyMessageDecoder()
public HAProxyMessageDecoder(boolean failFast)
failFast - Whether or not to throw an exception as soon as we exceed maxLengthpublic HAProxyMessageDecoder(int maxTlvSize)
Note: limiting TLV size only affects processing of v2, binary headers. Also, as allowed by the 1.5 spec
TLV data is currently ignored. For maximum performance it would be best to configure your upstream proxy host to
NOT send TLV data and instantiate with a max TLV size of 0.
maxTlvSize - maximum number of bytes allowed for additional data (Type-Length-Value vectors) in a v2 headerpublic HAProxyMessageDecoder(int maxTlvSize,
boolean failFast)
maxTlvSize - maximum number of bytes allowed for additional data (Type-Length-Value vectors) in a v2 headerfailFast - Whether or not to throw an exception as soon as we exceed maxLengthpublic boolean isSingleDecode()
isSingleDecode in class io.netty.handler.codec.ByteToMessageDecoderpublic void channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg)
throws Exception
channelRead in interface io.netty.channel.ChannelInboundHandlerchannelRead in class io.netty.handler.codec.ByteToMessageDecoderExceptionprotected final void decode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf in,
List<Object> out)
throws Exception
decode in class io.netty.handler.codec.ByteToMessageDecoderExceptionpublic static io.netty.handler.codec.ProtocolDetectionResult<HAProxyProtocolVersion> detectProtocol(io.netty.buffer.ByteBuf buffer)
ProtocolDetectionResult for the given ByteBuf.Copyright © 2008–2025 The Netty Project. All rights reserved.