List of usage examples for io.netty.handler.codec.haproxy HAProxyMessageDecoder HAProxyMessageDecoder
public HAProxyMessageDecoder()
From source file:diskCacheV111.doors.NettyLineBasedDoor.java
License:Open Source License
@Override public void handlerAdded(ChannelHandlerContext ctx) throws Exception { ChannelPipeline pipeline = ctx.pipeline(); String self = ctx.name();/*w w w . j a va2s. co m*/ if (expectProxyProtocol) { pipeline.addBefore("door", "haproxy", new HAProxyMessageDecoder()); } // Decoders pipeline.addBefore(self, "frameDecoder", new LineBasedFrameDecoder(KiB.toBytes(64))); pipeline.addBefore(self, "stringDecoder", new StringDecoder(charset)); // Encoder pipeline.addBefore(self, "lineEncoder", new LineEncoder(lineSeparator, charset)); pipeline.addBefore(self, "logger", new LoggingHandler()); }