List of usage examples for io.netty.handler.codec.http2 Http2MultiplexCodecBuilder forServer
public static Http2MultiplexCodecBuilder forServer(ChannelHandler childHandler)
From source file:example.http2.helloworld.multiplex.server.Http2OrHttpHandler.java
License:Apache License
@Override protected void configurePipeline(ChannelHandlerContext ctx, String protocol) throws Exception { if (ApplicationProtocolNames.HTTP_2.equals(protocol)) { ctx.pipeline().addLast(Http2MultiplexCodecBuilder.forServer(new HelloWorldHttp2Handler()).build()); return;/* w w w . j a v a 2 s .co m*/ } if (ApplicationProtocolNames.HTTP_1_1.equals(protocol)) { ctx.pipeline().addLast(new HttpServerCodec(), new HttpObjectAggregator(MAX_CONTENT_LENGTH), new HelloWorldHttp1Handler("ALPN Negotiation")); return; } throw new IllegalStateException("unknown protocol: " + protocol); }