java类io.netty.handler.codec.http.HttpContentDecompressor的实例源码

ConnectionManager.java 文件源码 项目:HeliosStreams 阅读 19 收藏 0 点赞 0 评论 0
@Override
protected void initChannel(final SocketChannel sc) throws Exception {
     ChannelPipeline p = sc.pipeline();          
     p.addLast(new HttpContentCompressor());
     p.addLast(new HttpClientCodec());
     p.addLast(new HttpContentDecompressor());      
     p.addLast(new HttpObjectAggregator(1048576));
}
PipelineFactory.java 文件源码 项目:HeliosStreams 阅读 24 收藏 0 点赞 0 评论 0
/**
 * Modifies the pipeline to handle HTTP requests
 * @param ctx The calling channel handler context
 * @param maxRequestSize The maximum request size in bytes
 */
private void switchToHttp(final ChannelHandlerContext ctx, final int maxRequestSize) {
    ChannelPipeline p = ctx.pipeline();         
    p.addLast("httpHandler", new HttpServerCodec());  // TODO: config ?
    p.addLast("decompressor", new HttpContentDecompressor());
    p.addLast("aggregator", new HttpObjectAggregator(maxRequestSize)); 
    p.addLast("jsonDecoder", new JsonObjectDecoder(maxRequestSize, false));
    p.addLast("handler", jsonRpcHandler);
    p.remove(this);
}
HubManager.java 文件源码 项目:HeliosStreams 阅读 27 收藏 0 点赞 0 评论 0
@Override
        public void initChannel(final SocketChannel ch) throws Exception {
            final ChannelPipeline p = ch.pipeline();
            //p.addLast("timeout",    new IdleStateHandler(0, 0, 60));  // TODO: configurable

            p.addLast("httpcodec",    new HttpClientCodec());
            p.addLast("inflater",   new HttpContentDecompressor());
            //p.addLast("aggregator", new HttpObjectAggregator(1048576));
            p.addLast("qdecoder", queryResultDecoder);
//          p.addLast("logging", loggingHandler);
        }
HubManager.java 文件源码 项目:HeliosStreams 阅读 32 收藏 0 点赞 0 评论 0
/**
     * {@inheritDoc}
     * @see io.netty.channel.pool.ChannelPoolHandler#channelCreated(io.netty.channel.Channel)
     */
    @Override
    public void channelCreated(final Channel ch) throws Exception {
        log.debug("Channel Created: {}", ch);
        channelGroup.add(ch);
        final ChannelPipeline p = ch.pipeline();
        //p.addLast("timeout",    new IdleStateHandler(0, 0, 60));  // TODO: configurable       
        p.addLast("httpcodec",    new HttpClientCodec());
        p.addLast("inflater",   new HttpContentDecompressor());
//      p.addLast("deflater",   new HttpContentCompressor());
        p.addLast("aggregator", new HttpObjectAggregator(20485760));
//      p.addLast("logging", loggingHandler);
        p.addLast("qdecoder", queryResultDecoder);

    }
HttpClient.java 文件源码 项目:reactor-netty 阅读 21 收藏 0 点赞 0 评论 0
@Override
public void accept(ChannelPipeline pipeline, ContextHandler<Channel> c) {
    pipeline.addLast(NettyPipeline.HttpCodec, new HttpClientCodec());
    if (options.acceptGzip()) {
        pipeline.addAfter(NettyPipeline.HttpCodec,
                NettyPipeline.HttpDecompressor,
                new HttpContentDecompressor());
    }
}
NettyClient_NoHttps.java 文件源码 项目:little_mitm 阅读 34 收藏 0 点赞 0 评论 0
@Override
protected void initChannel(SocketChannel ch) throws Exception {
    ChannelPipeline p = ch.pipeline();
    if (sslCtx != null) {
        p.addLast(sslCtx.newHandler(ch.alloc()));
    }
    p.addLast("log", new LoggingHandler(LogLevel.TRACE));
    p.addLast("codec", new HttpClientCodec());
    p.addLast("inflater", new HttpContentDecompressor());
    // p.addLast("aggregator", new HttpObjectAggregator(10 * 1024 * 1024));
    p.addLast("handler", handler);
}
NettyHttpCompressTest.java 文件源码 项目:Camel 阅读 18 收藏 0 点赞 0 评论 0
@Override
protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry registry = super.createRegistry();
    List<ChannelHandler> decoders = new ArrayList<ChannelHandler>();
    decoders.add(new HttpContentDecompressor());
    registry.bind("myDecoders", decoders);
    return registry;
}
BootstrapTemplate.java 文件源码 项目:netty-cookbook 阅读 20 收藏 0 点赞 0 评论 0
@Override
public void initChannel(SocketChannel ch) {
    ChannelPipeline p = ch.pipeline();      
    if (sslCtx != null) {
        p.addLast(sslCtx.newHandler(ch.alloc()));
    }
    p.addLast(new HttpClientCodec());
    p.addLast(new HttpContentDecompressor());       
    p.addLast(handler);
}
BootstrapTemplate.java 文件源码 项目:netty-cookbook 阅读 23 收藏 0 点赞 0 评论 0
@Override
public void initChannel(SocketChannel ch) {
    ChannelPipeline p = ch.pipeline();      
    if (sslCtx != null) {
        p.addLast(sslCtx.newHandler(ch.alloc()));
    }
    p.addLast(new HttpClientCodec());
    p.addLast(new HttpContentDecompressor());       
    p.addLast(handler);
}
BootstrapTemplate.java 文件源码 项目:netty-cookbook 阅读 21 收藏 0 点赞 0 评论 0
@Override
public void initChannel(SocketChannel ch) {
    ChannelPipeline p = ch.pipeline();      
    if (sslCtx != null) {
        p.addLast(sslCtx.newHandler(ch.alloc()));
    }
    p.addLast(new HttpClientCodec());
    p.addLast(new HttpContentDecompressor());       
    p.addLast(handler);
}


问题


面经


文章

微信
公众号

扫码关注公众号