Search in sources :

Example 1 with InboundHttp2ToHttpAdapter

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());
}
Also used : DefaultHttp2Connection(io.netty.handler.codec.http2.DefaultHttp2Connection) InboundHttp2ToHttpAdapterBuilder(io.netty.handler.codec.http2.InboundHttp2ToHttpAdapterBuilder) InboundHttp2ToHttpAdapter(io.netty.handler.codec.http2.InboundHttp2ToHttpAdapter) HttpToHttp2ConnectionHandlerBuilder(io.netty.handler.codec.http2.HttpToHttp2ConnectionHandlerBuilder)

Aggregations

DefaultHttp2Connection (io.netty.handler.codec.http2.DefaultHttp2Connection)1 HttpToHttp2ConnectionHandlerBuilder (io.netty.handler.codec.http2.HttpToHttp2ConnectionHandlerBuilder)1 InboundHttp2ToHttpAdapter (io.netty.handler.codec.http2.InboundHttp2ToHttpAdapter)1 InboundHttp2ToHttpAdapterBuilder (io.netty.handler.codec.http2.InboundHttp2ToHttpAdapterBuilder)1