ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

quic-go测试

2020-03-28 11:00:30  阅读:1097  来源: 互联网

标签:quic HTTP 测试 8088 QUIC go localhost


<style></style>

QUIC(Quick UDP Internet Connections)是基于UDP的多路复用和安全的通用传输层协议,相当于在UDP上实现了TCP+TLS+HTTP/2数据传输。

理论上quic采用UDP传输数据,封装了TLS和HTTP/2(HTTP3协议中,quic仅封装TLS,HTTP3协议数据基于quic协议传输),首次连接加载时间为2RTT,之后重新为1RTT。

QUIC是HTTP3的基础。目前quic协议未定稿,变动频繁。

quic-go测试示例

git clone https://gitee.com/yuxio/quic-go.git
cd quic-go/example
go build -o ser main.go
go build -o cli client/main.go

运行:

示例采用单向认证方式,证书签发的CN=localhost,不能使用IP。

 ./ser -bind ":8088" 
server GET localhost:8088/demo/tiles
server Responding with 200
server Peer closed session with error: Application error 0x100
server Connection 0xfc314d4e5df5d38b closed.
./cli https://localhost:8088/demo/tiles
GET https://localhost:8088/demo/tiles
client Starting new connection to localhost ([::]:52586 -> 127.0.0.1:8088), source connection ID (empty), destination connection ID 0xfc314d4e5df5d38b, version TLS dev version (WIP)
Got response for https://localhost:8088/demo/tiles: &http.Response{Status:"200 OK", StatusCode:200, Proto:"HTTP/3", ProtoMajor:3, ProtoMinor:0, Header:http.Header{}, Body:(*http3.body)(0xc000324a00), ContentLength:0, TransferEncoding:[]string(nil), Close:false, Uncompressed:false, Trailer:http.Header(nil), Request:(*http.Request)(nil), TLS:(*tls.ConnectionState)(nil)}
Request Body:
<html><head><style>img{width:40px;height:40px;}</style></head><body><img src="/demo/tile?cachebust=0">...<img src="/demo/tile?cachebust=199"></body></html>
client Closing session with error: Application error 0x100
client Connection 0xfc314d4e5df5d38b closed.

QUIC单向认证(22数据帧)

目前测试quic-go:同等条件下QUIC比HTTP2传输的数据包少,时间应该较短,目前测试效果不佳,但相差不大。大数据量、多次连接时QUIC才能体现优势。

 

参考:

 

  1. Cronet网络库系列(三):HTTPS/HTTP2/HTTP3/QUIC/WebSocket详解

  2. 快速读懂QUIC协议

  3. 如何看待 HTTP/3 ?

  4. HTTP/2.0 相比1.0有哪些重大改进?

<style></style> <style></style> <style></style>

标签:quic,HTTP,测试,8088,QUIC,go,localhost
来源: https://www.cnblogs.com/embedded-linux/p/12586246.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有