@Override protected void initChannel(SocketChannel ch) throws Exception { channelGroup.add(ch); ChannelPipeline pipeline = ch.pipeline(); if (sslHandlerFactory != null) { // Add SSLHandler if SSL is enabled pipeline.addLast("ssl", sslHandlerFactory.create(ch.alloc())); } pipeline.addLast("codec", new HttpServerCodec()); pipeline.addLast("compressor", new HttpContentCompressor()); pipeline.addLast("chunkedWriter", new ChunkedWriteHandler()); pipeline.addLast("keepAlive", new HttpServerKeepAliveHandler()); pipeline.addLast("router", new RequestRouter(resourceHandler, httpChunkLimit, sslHandlerFactory != null)); if (eventExecutorGroup == null) { pipeline.addLast("dispatcher", new HttpDispatcher()); } else { pipeline.addLast(eventExecutorGroup, "dispatcher", new HttpDispatcher()); } if (pipelineModifier != null) { pipelineModifier.modify(pipeline); } } });