@Override public void handlerAdded(ChannelHandlerContext ctx) throws Exception { LOGGER.info("{} : handlerAdded", connectionInfo); Http2Connection connection = new DefaultHttp2Connection(true); ChannelHandler http2ConnHandler = new HttpToHttp2ConnectionHandlerBuilder() .frameListener(new DelegatingDecompressorFrameListener( connection, new InboundHttp2ToHttpAdapterBuilder(connection) .maxContentLength(master.config().getMaxContentLength()) .propagateSettings(true) .build())) .connection(connection) .frameLogger(new Http2FrameLogger(LogLevel.DEBUG)) .build(); ctx.pipeline() .addBefore(ctx.name(), null, http2ConnHandler) .addBefore(ctx.name(), null, new Http2Handler()); }
@Override public void handlerAdded(ChannelHandlerContext ctx) throws Exception { LOGGER.info("{} : handlerAdded", connectionInfo); Http2Connection connection = new DefaultHttp2Connection(false); ChannelHandler http2ConnHandler = new HttpToHttp2ConnectionHandlerBuilder() .frameListener(new DelegatingDecompressorFrameListener( connection, new InboundHttp2ToHttpAdapterBuilder(connection) .maxContentLength(master.config().getMaxContentLength()) .propagateSettings(true) .build())) .frameLogger(new Http2FrameLogger(LogLevel.DEBUG)) .connection(connection) .build(); ctx.pipeline() .addBefore(ctx.name(), null, http2ConnHandler) .addBefore(ctx.name(), null, new Http2Handler()); }
@Override public void initChannel(SocketChannel ch) throws Exception { final Http2Connection connection = new DefaultHttp2Connection(false); connectionHandler = new HttpToHttp2ConnectionHandlerBuilder() .frameListener(new DelegatingDecompressorFrameListener( connection, new InboundHttp2ToHttpAdapterBuilder(connection) .maxContentLength(maxContentLength) .propagateSettings(true) .build())) .frameLogger(logger) .connection(connection) .build(); responseHandler = new HttpResponseHandler(); settingsHandler = new Http2SettingsHandler(ch.newPromise()); if (sslCtx != null) { configureSsl(ch); } else { configureClearText(ch); } }
@Override public void initChannel(SocketChannel ch) throws Exception { final Http2Connection connection = new DefaultHttp2Connection(false); connectionHandler = new HttpToHttp2ConnectionHandlerBuilder() .frameListener(new DelegatingDecompressorFrameListener( connection, new InboundHttp2ToHttpAdapterBuilder(connection) .maxContentLength(maxContentLength) .propagateSettings(true) .build())) .frameLogger(logger) .connection(connection) .build(); responseHandler = new HTTP2ResponseHandler(); settingsHandler = new HTTP2SettingsHandler(ch.newPromise()); if (sslCtx != null) { configureSsl(ch); } else { configureClearText(ch); } }
private Http2ConnectionHandler newHttp2ConnectionHandler(final ChannelPipeline p) { DefaultHttp2Connection connection = new DefaultHttp2Connection(true); InboundHttp2ToHttpAdapter listener = new InboundHttp2ToHttpAdapterBuilder(connection) .propagateSettings(false) .validateHttpHeaders(false) .maxContentLength(maxContentLength) .build(); HttpToHttp2ConnectionHandler http2handler = new HttpToHttp2ConnectionHandlerBuilder() .frameListener(listener) .frameLogger(new Http2FrameLogger(LogLevel.DEBUG)) .connection(connection) .build(); return http2handler; }
private static void configureHttp2(ChannelHandlerContext ctx) { DefaultHttp2Connection connection = new DefaultHttp2Connection(true); InboundHttp2ToHttpAdapter listener = new InboundHttp2ToHttpAdapterBuilder(connection) .propagateSettings(true).validateHttpHeaders(false) .maxContentLength(MAX_CONTENT_LENGTH).build(); ctx.pipeline().addLast(new HttpToHttp2ConnectionHandlerBuilder() .frameListener(listener) // .frameLogger(TilesHttp2ToHttpHandler.logger) .connection(connection).build()); ctx.pipeline().addLast(new Http2RequestHandler()); }
@Override public void initChannel(SocketChannel ch) throws Exception { final ChannelPipeline p = ch.pipeline(); final Http2Connection conn = new DefaultHttp2Connection(false); final HttpToHttp2ConnectionHandler connHandler = new HttpToHttp2ConnectionHandlerBuilder() .connection(conn) .frameListener(new DelegatingDecompressorFrameListener( conn, new InboundHttp2ToHttpAdapterBuilder(conn) .maxContentLength(Integer.MAX_VALUE) .propagateSettings(true).build())) .build(); clientHandler = new THttp2ClientHandler(ch.eventLoop()); if (sslCtx != null) { p.addLast(sslCtx.newHandler(p.channel().alloc())); p.addLast(connHandler); configureEndOfPipeline(p); } else { Http1ClientCodec sourceCodec = new Http1ClientCodec(); HttpClientUpgradeHandler upgradeHandler = new HttpClientUpgradeHandler( sourceCodec, new Http2ClientUpgradeCodec(connHandler), 65536); p.addLast(sourceCodec, upgradeHandler, new UpgradeRequestHandler()); } }