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

项目:blade    文件:HttpServerInitializer.java   
@Override
protected void initChannel(SocketChannel ch) throws Exception {
    ChannelPipeline p = ch.pipeline();
    if (sslCtx != null) {
        p.addLast(sslCtx.newHandler(ch.alloc()));
    }
    if (enableGzip) {
        p.addLast(new HttpContentCompressor());
    }
    p.addLast(new HttpServerCodec(36192 * 2, 36192 * 8, 36192 * 16, false));
    p.addLast(new HttpServerExpectContinueHandler());
    p.addLast(new HttpObjectAggregator(Integer.MAX_VALUE));
    p.addLast(new ChunkedWriteHandler());
    if (enableCors) {
        CorsConfig corsConfig = CorsConfigBuilder.forAnyOrigin().allowNullOrigin().allowCredentials().build();
        p.addLast(new CorsHandler(corsConfig));
    }
    if (null != blade.webSocketPath()) {
        p.addLast(new WebSocketServerProtocolHandler(blade.webSocketPath(), null, true));
        p.addLast(new WebSockerHandler(blade));
    }
    service.scheduleWithFixedDelay(() -> date = new AsciiString(DateKit.gmtDate(LocalDateTime.now())), 1000, 1000, TimeUnit.MILLISECONDS);
    p.addLast(new HttpServerHandler());
}
项目:Ink    文件:HttpChannelInitializer.java   
@Override
protected void initChannel(SocketChannel socketChannel) throws Exception {
    socketChannel.pipeline().addLast(
            new HttpServerCodec(),
            new HttpServerExpectContinueHandler(),
            new HttpObjectAggregator(Integer.MAX_VALUE),
            new ChunkedWriteHandler(),
            new HttpRequestHandler()
    );
}
项目:teslog    文件:HttpHelloWorldServerInitializer.java   
@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());
}
项目:byproxy    文件: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));
}
项目:byproxy    文件:SSLDetector.java   
private void setHttpInterceptor(ChannelHandlerContext ctx, boolean ssl) {
    ctx.pipeline().addLast(new HttpServerCodec());
    ctx.pipeline().addLast("", new HttpServerExpectContinueHandler());
    ctx.pipeline().addLast("replay-handler", new ReplayHandler(outboundChannel));

    outboundChannel.pipeline().addLast(new HttpClientCodec());
    HttpInterceptor interceptor = new HttpInterceptor(ssl, address, messageListener, ctx.pipeline());
    outboundChannel.pipeline().addLast("http-interceptor", interceptor);
    outboundChannel.pipeline().addLast("replay-handler", new ReplayHandler(ctx.channel()));
}
项目:Razor    文件:HttpServerInitializer.java   
@Override
public void initChannel(final SocketChannel socketChannel) throws Exception {

    ChannelPipeline pl = socketChannel.pipeline();

    // TODO ssl handler

    pl.addLast("codec", new HttpServerCodec());

    // enable gzip
    if (razor.getEnv().getBool(ENV_KEY_GZIP, DEFAULT_GZIP_ENABLE)) {

        pl.addLast("gzip", new HttpContentCompressor());
    }

    pl.addLast("continue", new HttpServerExpectContinueHandler());
    pl.addLast("aggregator", new HttpObjectAggregator(512*1024));
    pl.addLast("chunk", new ChunkedWriteHandler());

    pl.addLast("request", new HttpServerHandler(razor));
}
项目:byproxy    文件:HttpProxyMatcher.java   
@Override
public void handlePipeline(ChannelPipeline pipeline) {
    pipeline.addLast(new HttpServerCodec());
    pipeline.addLast("", new HttpServerExpectContinueHandler());
    pipeline.addLast(new HttpProxyHandler(messageListener, proxyHandlerSupplier));
}