类 io.netty.handler.codec.http.HttpServerExpectContinueHandler 源码实例Demo

下面列出了怎么用 io.netty.handler.codec.http.HttpServerExpectContinueHandler 的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: blade   文件: HttpServerInitializer.java

@Override
protected void initChannel(SocketChannel ch) {
    ChannelPipeline pipeline = ch.pipeline();
    try {
        if (sslCtx != null) {
            pipeline.addLast(sslCtx.newHandler(ch.alloc()));
        }

        pipeline.addLast(new HttpServerCodec());
        pipeline.addLast(new HttpServerExpectContinueHandler());

        if (useGZIP) {
            pipeline.addLast(new HttpContentCompressor());
        }

        if (isWebSocket) {
            pipeline.addLast(new WebSocketHandler(blade));
        }
        pipeline.addLast(new MergeRequestHandler());
        pipeline.addLast(httpServerHandler);
    } catch (Exception e) {
        log.error("Add channel pipeline error", e);
    }
}
 

@Override
public void initChannel(SocketChannel ch) {
    ChannelPipeline p = ch.pipeline();
    if (sslCtx != null) {
        p.addLast(sslCtx.newHandler(ch.alloc()));
    }
    p.addLast(new HttpServerCodec());
    p.addLast(new HttpServerExpectContinueHandler());
    p.addLast(new HttpHelloWorldServerHandler());
}
 

@Override
public void initChannel(SocketChannel ch) {
    ChannelPipeline p = ch.pipeline();
    /**
     * 或者使用HttpRequestDecoder & HttpResponseEncoder
     */
    p.addLast(new HttpServerCodec());
    /**
     * 在处理POST消息体时需要加上
     */
    p.addLast(new HttpObjectAggregator(1024*1024));
    p.addLast(new HttpServerExpectContinueHandler());
    p.addLast(new HttpHelloWorldServerHandler());
}
 

@Override
public void buildChannelPipeline(ChannelPipeline pipeline) {
    pipeline.addLast(new HttpServerCodec());
    pipeline.addLast(new HttpServerExpectContinueHandler());
    pipeline.addLast(MsgOutboundHandler.INSTANCE);
    if(socketConfiguration.getProtocolType() == SocketConfiguration.ProtocolType.TEXT){
        pipeline.addLast(new DefaultTextWebSocketServerHandler());
    }else{
        pipeline.addLast(new ProtocolWebSocketServerHandler());
    }
}
 

@Override
public void initChannel(SocketChannel ch) {
    ChannelPipeline p = ch.pipeline();
    if (sslCtx != null) {
        p.addLast(sslCtx.newHandler(ch.alloc()));
    }
    p.addLast(new HttpServerCodec());
    p.addLast(new HttpServerExpectContinueHandler());
    p.addLast(new HttpHelloWorldServerHandler());
}
 
源代码6 项目: cute-proxy   文件: HttpMatcher.java

@Override
public void handlePipeline(ChannelPipeline pipeline) {
    pipeline.addLast(new HttpServerCodec());
    pipeline.addLast(new HttpServerExpectContinueHandler());
    pipeline.addLast(new HttpObjectAggregator(65536));
    pipeline.addLast(new ChunkedWriteHandler());
    pipeline.addLast(new HttpContentCompressor());
    pipeline.addLast(new HttpRequestHandler(sslContextManager));
}
 
源代码7 项目: cute-proxy   文件: SSLDetector.java

private void setHttpInterceptor(ChannelHandlerContext ctx, boolean ssl) {
    ctx.pipeline().addLast("http-codec", new HttpServerCodec());
    ctx.pipeline().addLast(new HttpServerExpectContinueHandler());
    ctx.pipeline().addLast("replay-handler", new ReplayHandler(outboundChannel));

    outboundChannel.pipeline().addLast("http-codec", new HttpClientCodec());
    var httpUpgradeHandler = new HttpUpgradeHandler(ssl, address, messageListener, ctx.pipeline());
    outboundChannel.pipeline().addLast("http-upgrade-handler", httpUpgradeHandler);
    var httpInterceptor = new HttpInterceptor(ssl, address, messageListener);
    outboundChannel.pipeline().addLast("http-interceptor", httpInterceptor);
    outboundChannel.pipeline().addLast("replay-handler", new ReplayHandler(ctx.channel()));
}
 
源代码8 项目: nomulus   文件: WebWhoisProtocolsModule.java

@Provides
@HttpWhoisProtocol
static ImmutableList<Provider<? extends ChannelHandler>> providerHttpWhoisHandlerProviders(
    Provider<HttpServerCodec> httpServerCodecProvider,
    Provider<HttpServerExpectContinueHandler> httpServerExpectContinueHandlerProvider,
    @HttpWhoisProtocol Provider<WebWhoisRedirectHandler> webWhoisRedirectHandlerProvides) {
  return ImmutableList.of(
      httpServerCodecProvider,
      httpServerExpectContinueHandlerProvider,
      webWhoisRedirectHandlerProvides);
}
 
源代码9 项目: nomulus   文件: WebWhoisProtocolsModule.java

@Provides
@HttpsWhoisProtocol
static ImmutableList<Provider<? extends ChannelHandler>> providerHttpsWhoisHandlerProviders(
    @HttpsWhoisProtocol
        Provider<SslServerInitializer<NioSocketChannel>> sslServerInitializerProvider,
    Provider<HttpServerCodec> httpServerCodecProvider,
    Provider<HttpServerExpectContinueHandler> httpServerExpectContinueHandlerProvider,
    @HttpsWhoisProtocol Provider<WebWhoisRedirectHandler> webWhoisRedirectHandlerProvides) {
  return ImmutableList.of(
      sslServerInitializerProvider,
      httpServerCodecProvider,
      httpServerExpectContinueHandlerProvider,
      webWhoisRedirectHandlerProvides);
}
 
源代码10 项目: cute-proxy   文件: HttpProxyMatcher.java

@Override
public void handlePipeline(ChannelPipeline pipeline) {
    pipeline.addLast(new HttpServerCodec());
    pipeline.addLast("", new HttpServerExpectContinueHandler());
    pipeline.addLast(new HttpProxyHandler(messageListener, proxyHandlerSupplier));
}
 
源代码11 项目: nomulus   文件: WebWhoisProtocolsModule.java

@Provides
static HttpServerExpectContinueHandler provideHttpServerExpectContinueHandler() {
  return new HttpServerExpectContinueHandler();
}
 
 同包方法