@Override protected void initChannel(Channel ch) throws Exception { final ChannelPipeline pipeline = ch.pipeline(); if (config.sslContext() != null) { SSLEngine e = config.sslContext().createSSLEngine(); config.sslContextListener().onPostCreate(e); pipeline.addLast("ssl", new SslHandler(e)); } if (config.nettySslContext() != null) { pipeline.addLast("ssl", config.nettySslContext().newHandler(ch.alloc())); } pipeline.addLast("decoder", new HttpRequestDecoder()); pipeline.addLast("aggregator", new HttpObjectAggregator(config.maxChunkContentLength())); if (config.supportChunking()) { pipeline.addLast("chunkedWriter", new ChunkedWriteHandler()); } for (ChannelInboundHandler h: config.channelUpstreamHandlers()) { pipeline.addLast(h.getClass().getName(), h); } pipeline.addLast(new WebSocketServerCompressionHandler()); pipeline.addLast(BridgeRuntime.class.getName(), bridgeRuntime); }
@Override protected void initChannel(Channel ch) throws Exception { final ChannelPipeline pipeline = ch.pipeline(); if (config.sslContext() != null) { SSLEngine e = config.sslContext().createSSLEngine(); config.sslContextListener().onPostCreate(e); pipeline.addLast("ssl", new SslHandler(e)); } if (config.nettySslContext() != null) { pipeline.addLast("ssl", config.nettySslContext().newHandler(ch.alloc())); } pipeline.addLast("decoder", new HttpRequestDecoder()); pipeline.addLast("aggregator", new HttpObjectAggregator(config.maxChunkContentLength())); if (config.supportChunking()) { pipeline.addLast("chunkedWriter", new ChunkedWriteHandler()); } for (ChannelInboundHandler h: config.channelUpstreamHandlers()) { pipeline.addLast(h.getClass().getName(), h); } pipeline.addLast(new WebSocketServerCompressionHandler()); pipeline.addLast(BridgeRuntime.class.getName(), bridgeRuntime); }