use of io.netty.handler.codec.http2.InboundHttp2ToHttpAdapter in project netty by netty.
the class Http2OrHttpHandler method configureHttp2.
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).connection(connection).build());
ctx.pipeline().addLast(new Http2RequestHandler());
}
Aggregations