package moe.ymc.acron.net; import io.netty.channel.ChannelInitializer; import io.netty.channel.socket.SocketChannel; import io.netty.handler.codec.http.HttpObjectAggregator; import io.netty.handler.codec.http.HttpServerCodec; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; /** * A channel initializer for all Acron handlers. */ public class AcronInitializer extends ChannelInitializer { private static final Logger LOGGER = LogManager.getLogger(); @Override protected void initChannel(SocketChannel ch) throws Exception { LOGGER.debug("initChannel"); ch.pipeline() .addLast(new HttpServerCodec()) .addLast(new HttpObjectAggregator(65536)) .addLast(new AuthHandler()) ; } }