List of usage examples for io.netty.handler.codec.http2 Http2ConnectionHandlerBuilder Http2ConnectionHandlerBuilder
Http2ConnectionHandlerBuilder
From source file:org.wso2.carbon.http2.transport.util.Http2ClientInitializer.java
License:Open Source License
/** * Initiate Http2 connection as clearText or TCP secured * * @param ch// w w w . ja va 2s . co m * @throws Exception */ @Override public void initChannel(SocketChannel ch) throws Exception { final Http2Connection connection = new DefaultHttp2Connection(false); Http2FrameListenAdapter clientFrameListener = new Http2FrameListenAdapter(); listener = new DelegatingDecompressorFrameListener(connection, clientFrameListener); connectionHandler = new Http2ConnectionHandlerBuilder().connection(connection).frameLogger(logger) .frameListener(listener).build(); responseHandler = new Http2ClientHandler(connection); responseHandler.setEncoder(connectionHandler.encoder()); settingsHandler = new Http2SettingsHandler(ch.newPromise(), responseHandler); if (sslCtx != null) { configureSsl(ch); } else { configureClearText(ch); } }
From source file:org.wso2.carbon.inbound.endpoint.protocol.http2.InboundHttp2ServerInitializer.java
License:Open Source License
/** * Channel initialization//from w ww.j a va 2 s . c om * * @param ch */ @Override public void initChannel(SocketChannel ch) { Http2Connection conn = new DefaultHttp2Connection(true); Http2FrameListenAdapter listenAdapter = new Http2FrameListenAdapter(); Http2ConnectionHandler connectionHandler = new Http2ConnectionHandlerBuilder().connection(conn) .frameLogger(logger).frameListener(listenAdapter).build(); InboundHttp2SourceHandler sourceHandler = new InboundHttp2SourceHandler(this.config, conn, connectionHandler.encoder()); if (sslCtx != null) { configureSsl(ch, connectionHandler, sourceHandler); } else { configureClearText(ch, connectionHandler, sourceHandler); } }