Giter Site home page Giter Site logo

clb-quic-demo's People

Contributors

leonardjin avatar studytnot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clb-quic-demo's Issues

请教图片域名和备选的域名不一致能匹配上吗?确定使用了quic?

private static String[] imageUrls= {
        "https://stgwhttp2.kof.qq.com/1.jpg",
        "https://stgwhttp2.kof.qq.com/2.jpg",
        "https://stgwhttp2.kof.qq.com/3.jpg",
        "https://stgwhttp2.kof.qq.com/4.jpg",
        "https://stgwhttp2.kof.qq.com/5.jpg",
        "https://stgwhttp2.kof.qq.com/6.jpg",
        "https://stgwhttp2.kof.qq.com/7.jpg",
        "https://stgwhttp2.kof.qq.com/8.jpg",
        "https://stgwhttp2.kof.qq.com/01.jpg",
        "https://stgwhttp2.kof.qq.com/02.jpg",
        "https://stgwhttp2.kof.qq.com/03.jpg",
        "https://stgwhttp2.kof.qq.com/04.jpg",
        "https://stgwhttp2.kof.qq.com/05.jpg",
        "https://stgwhttp2.kof.qq.com/06.jpg",
        "https://stgwhttp2.kof.qq.com/07.jpg",
        "https://stgwhttp2.kof.qq.com/08.jpg"
};

private static synchronized CronetEngine getCronetEngine(Context context) {
    // Lazily create the Cronet engine.
    if (cronetEngine == null) {
        CronetEngine.Builder myBuilder = new CronetEngine.Builder(context);
        // Enable caching of HTTP data and
        // other information like QUIC server information, HTTP/2 protocol and QUIC protocol.
        cronetEngine = myBuilder
                .enableHttpCache(CronetEngine.Builder.HTTP_CACHE_DISABLED, 100 * 1024)
                .addQuicHint("stgwhttps.kof.qq.com", 443, 443)
                //.enableHttp2(true)
                .enableQuic(true)
                .build();
        //    .setUserAgent("clb_quic_demo")
    }
    return cronetEngine;
}

备选机制是URL匹配,或者是符合Google相关域名后缀匹配上才能使用,看log,并没有用上quic

quic性能对比h2

我自己用caddy搭建了一个支持quic的简易服务器,用的是腾讯云主机
2核2g4m带宽。
^Cnash:/ # ping fatdog.com.cn
PING fatdog.com.cn (123.206.27.238) 56(84) bytes of data.
64 bytes from 123.206.27.238: icmp_seq=1 ttl=51 time=30.6 ms
64 bytes from 123.206.27.238: icmp_seq=2 ttl=51 time=24.3 ms
64 bytes from 123.206.27.238: icmp_seq=3 ttl=51 time=35.6 ms
64 bytes from 123.206.27.238: icmp_seq=4 ttl=51 time=23.7 ms

PING stgwhttp2.kof.qq.com (101.226.76.237) 56(84) bytes of data.
64 bytes from 101.226.76.237: icmp_seq=1 ttl=53 time=27.5 ms
64 bytes from 101.226.76.237: icmp_seq=2 ttl=53 time=43.9 ms
64 bytes from 101.226.76.237: icmp_seq=3 ttl=53 time=46.2 ms
64 bytes from 101.226.76.237: icmp_seq=4 ttl=53 time=45.6 ms
64 bytes from 101.226.76.237: icmp_seq=5 ttl=53 time=37.1 ms
64 bytes from 101.226.76.237: icmp_seq=6 ttl=53 time=55.3 ms
64 bytes from 101.226.76.237: icmp_seq=7 ttl=53 time=45.2 ms
64 bytes from 101.226.76.237: icmp_seq=8 ttl=53 time=44.3 ms

ping检测我的那个云主机 网络还好一些,但是用该项目提供的demo, quic协议是比 h2快。
但是用我自己的那个服务器,quic协议就比h2慢。
我是自己编译的chromium64的网络库 quic协议39版本。 服务器证书用的let's encrypt。
这个问题会是什么? 有没有联系方式啊? 请教一下。

更新版本之后的问题

按照大神的更新文档更新了下cronet的版本,发现一个问题

使用原始的版本,走QUIC协议,请求了图片之后可以用wireshark抓到GQUIC协议
使用了最新的chromium发布的cronet android版本之后,GQUIC协议从此消失,全部走了TCP

不清楚内部发生了什么变化。。。

图片加载失败.

示例图片地址证书无效.
https://stgwhttp2.kof.qq.com/1.jpg

demo加载图片失败.
log
ViewAdapter: ****** onFailed, error is: Exception in CronetUrlRequest: net::ERR_CERT_DATE_INVALID, ErrorCode=11, InternalErrorCode=-201, Retryable=false

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.