• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java HttpToHttp2ConnectionHandlerBuilder类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中io.netty.handler.codec.http2.HttpToHttp2ConnectionHandlerBuilder的典型用法代码示例。如果您正苦于以下问题:Java HttpToHttp2ConnectionHandlerBuilder类的具体用法?Java HttpToHttp2ConnectionHandlerBuilder怎么用?Java HttpToHttp2ConnectionHandlerBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

HttpToHttp2ConnectionHandlerBuilder类属于io.netty.handler.codec.http2包,在下文中一共展示了HttpToHttp2ConnectionHandlerBuilder类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: handlerAdded

点赞 3

import io.netty.handler.codec.http2.HttpToHttp2ConnectionHandlerBuilder; //导入依赖的package包/类
@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());
}
 

开发者ID:chhsiao90,
项目名称:nitmproxy,
代码行数:20,
代码来源:Http2FrontendHandler.java

示例2: handlerAdded

点赞 3

import io.netty.handler.codec.http2.HttpToHttp2ConnectionHandlerBuilder; //导入依赖的package包/类
@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());
}
 

开发者ID:chhsiao90,
项目名称:nitmproxy,
代码行数:20,
代码来源:Http2BackendHandler.java

示例3: initChannel

点赞 3

import io.netty.handler.codec.http2.HttpToHttp2ConnectionHandlerBuilder; //导入依赖的package包/类
@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);
    }
}
 

开发者ID:cowthan,
项目名称:JavaAyo,
代码行数:22,
代码来源:Http2ClientInitializer.java

示例4: initChannel

点赞 3

import io.netty.handler.codec.http2.HttpToHttp2ConnectionHandlerBuilder; //导入依赖的package包/类
@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);
    }
}
 

开发者ID:wso2,
项目名称:carbon-transports,
代码行数:22,
代码来源:HTTP2ClientInitializer.java

示例5: newHttp2ConnectionHandler

点赞 3

import io.netty.handler.codec.http2.HttpToHttp2ConnectionHandlerBuilder; //导入依赖的package包/类
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;
}
 

开发者ID:jooby-project,
项目名称:jooby,
代码行数:17,
代码来源:NettyPipeline.java

示例6: configureHttp2

点赞 2

import io.netty.handler.codec.http2.HttpToHttp2ConnectionHandlerBuilder; //导入依赖的package包/类
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());
}
 

开发者ID:cowthan,
项目名称:JavaAyo,
代码行数:14,
代码来源:Http2OrHttpHandler.java

示例7: initChannel

点赞 2

import io.netty.handler.codec.http2.HttpToHttp2ConnectionHandlerBuilder; //导入依赖的package包/类
@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());
    }
}
 

开发者ID:line,
项目名称:armeria,
代码行数:28,
代码来源:THttp2Client.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)