public class HAProxyMessageDecoder
extends io.netty.handler.codec.ByteToMessageDecoder
| Constructor and Description |
|---|
HAProxyMessageDecoder()
Creates a new decoder with no additional data (TLV) restrictions
|
HAProxyMessageDecoder(int maxTlvSize)
Creates a new decoder with restricted additional data (TLV) size
Note: limiting TLV size only affects processing of v2, binary headers.
|
| 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, exceptionCaughtpublic HAProxyMessageDecoder()
public 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 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–2016 The Netty Project. All rights reserved.