Class HAProxyMessageDecoder

All Implemented Interfaces:
ChannelHandler, ChannelInboundHandler

public class HAProxyMessageDecoder extends ByteToMessageDecoder
Decodes an HAProxy proxy protocol header
See Also:
  • Constructor Details

    • HAProxyMessageDecoder

      public HAProxyMessageDecoder()
      Creates a new decoder with no additional data (TLV) restrictions, and should throw an exception as soon as we exceed maxLength.
    • HAProxyMessageDecoder

      public 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.
      Parameters:
      failFast - Whether or not to throw an exception as soon as we exceed maxLength
    • HAProxyMessageDecoder

      public HAProxyMessageDecoder(int maxTlvSize)
      Creates a new decoder with restricted additional data (TLV) size, and should throw an exception as soon as we exceed maxLength.

      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.

      Parameters:
      maxTlvSize - maximum number of bytes allowed for additional data (Type-Length-Value vectors) in a v2 header
    • HAProxyMessageDecoder

      public 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.
      Parameters:
      maxTlvSize - maximum number of bytes allowed for additional data (Type-Length-Value vectors) in a v2 header
      failFast - Whether or not to throw an exception as soon as we exceed maxLength
  • Method Details