tencentyun / clb-quic-demo Goto Github PK
View Code? Open in Web Editor NEWclb team contribute
License: Apache License 2.0
clb team contribute
License: Apache License 2.0
按照大神的更新文档更新了下cronet的版本,发现一个问题
使用原始的版本,走QUIC协议,请求了图片之后可以用wireshark抓到GQUIC协议
使用了最新的chromium发布的cronet android版本之后,GQUIC协议从此消失,全部走了TCP
不清楚内部发生了什么变化。。。
在wlan环境与4g使用demo测试了20+次,QUIC均慢于HTTP2.
可能的原因是什么呢。
是服务端下线了吗?
QUIC 的callback 中在onSucceeded 中取UrlResponseInfo.getNegotiatedProtocol 一直都返回的是h2。
不应该是http/2+quic/xx 吗?
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
示例图片地址证书无效.
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
我自己用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。
这个问题会是什么? 有没有联系方式啊? 请教一下。
观察了下依赖库的版本有点过老了,期待能更新一下版本
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.