feat(gin): support both http/2 and http/3 using quic-go/quic-go
53c1160a9cd5376a770713c4e0af95221b3b27dc
Update quick-go and add support for both TLS/TCP and QUIC connections in parallel using RunTLSAndQUIC
- Bump github.com/quic-go/quic-go from v0.43.1 to v0.44.0 and dependencies
- Created new func RunTLSAndQUIC to run both TLS/TCP and QUIC in parallel
e67f1e9212dcebf8901bca0c2f01243071bb9454
Updated intgration tests to support HTTP/3
- Added new test for RunTLSAndQUIC
- Added support for HTTP/3 with future tests
Latency Testing using RunTLSAndQUIC (this is not perfect or real world):
2024/05/20 09:44:32 Average time for HTTP/3: 2.278181ms
2024/05/20 09:44:32 Average time for HTTP/2: 2.012242ms
2024/05/20 09:44:32 Average time for HTTP/1.1: 1.589074ms
Using RunTLSAndQUIC:
- Client:
2024/05/20 09:46:31 HTTP/3:
2024/05/20 09:46:31 GET https://localhost:8080
2024/05/20 09:46:31 Got response for https://localhost:8080: "HTTP/3.0"
2024/05/20 09:46:31 Response Body:
{"links":[{"name":"Home","url":"/"},{"name":"Resume","url":"/resume/"},{"name":"Resources","url":"/resources/"},{"name":"Projects","url":"/projects/"},{"name":"Blog","url":"/blog/"},{"name":"About","url":"/about/"}]}
2024/05/20 09:46:31 HTTP/2:
2024/05/20 09:46:31 GET https://localhost:8080
2024/05/20 09:46:31 Got response for https://localhost:8080: "HTTP/2.0"
2024/05/20 09:46:31 Response Body:
{"links":[{"name":"Home","url":"/"},{"name":"Resume","url":"/resume/"},{"name":"Resources","url":"/resources/"},{"name":"Projects","url":"/projects/"},{"name":"Blog","url":"/blog/"},{"name":"About","url":"/about/"}]}
2024/05/20 09:46:31 HTTP/1.1:
2024/05/20 09:46:31 GET https://localhost:8080
2024/05/20 09:46:31 Got response for https://localhost:8080: "HTTP/1.1"
2024/05/20 09:46:31 Response Body:
{"links":[{"name":"Home","url":"/"},{"name":"Resume","url":"/resume/"},{"name":"Resources","url":"/resources/"},{"name":"Projects","url":"/projects/"},{"name":"Blog","url":"/blog/"},{"name":"About","url":"/about/"}]}
- Server:
[GIN] 2024/05/20 - 09:46:31 | 200 | 27.844µs | 127.0.0.1 | GET "/"
[GIN] 2024/05/20 - 09:46:31 | 200 | 16.351µs | 127.0.0.1 | GET "/"
[GIN] 2024/05/20 - 09:46:31 | 200 | 5.029µs | 127.0.0.1 | GET "/"
Using RunQUIC:
- Client:
2024/05/20 09:48:42 HTTP/3:
2024/05/20 09:48:42 GET https://localhost:8080
2024/05/20 09:48:42 Got response for https://localhost:8080: "HTTP/3.0"
2024/05/20 09:48:42 Response Body:
{"links":[{"name":"Home","url":"/"},{"name":"Resume","url":"/resume/"},{"name":"Resources","url":"/resources/"},{"name":"Projects","url":"/projects/"},{"name":"Blog","url":"/blog/"},{"name":"About","url":"/about/"}]}
2024/05/20 09:48:42 HTTP/2:
2024/05/20 09:48:42 GET https://localhost:8080
2024/05/20 09:48:42 Get "https://localhost:8080": dial tcp [::1]:8080: connect: connection refused
2024/05/20 09:48:42 HTTP/1.1:
2024/05/20 09:48:42 GET https://localhost:8080
2024/05/20 09:48:42 Get "https://localhost:8080": dial tcp [::1]:8080: connect: connection refused
- Server:
[GIN] 2024/05/20 - 09:48:42 | 200 | 52.529µs | 127.0.0.1 | GET "/"
- With pull requests:
- Open your pull request against
master - Your pull request should have no more than two commits, if not you should squash them.
- It should pass all tests in the available continuous integration systems such as GitHub Actions.
- You should add/modify tests to cover your proposed code changes.
- If your pull request contains a new feature, please document it on the README.
- Open your pull request against
Signed-off-by: Diana Moore [email protected]
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.05%. Comparing base (
3dc1cd6) to head (e67f1e9). Report is 67 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #3973 +/- ##
==========================================
- Coverage 99.21% 99.05% -0.16%
==========================================
Files 42 44 +2
Lines 3182 2759 -423
==========================================
- Hits 3157 2733 -424
+ Misses 17 15 -2
- Partials 8 11 +3
| Flag | Coverage Δ | |
|---|---|---|
? |
||
| -tags "sonic avx" | 99.05% <100.00%> (?) |
|
| -tags go_json | 99.05% <100.00%> (?) |
|
| -tags nomsgpack | 99.04% <100.00%> (?) |
|
| go-1.18 | ? |
|
| go-1.19 | ? |
|
| go-1.20 | ? |
|
| go-1.21 | 99.05% <100.00%> (-0.16%) |
:arrow_down: |
| go-1.22 | 99.05% <100.00%> (?) |
|
| macos-latest | 99.05% <100.00%> (-0.16%) |
:arrow_down: |
| ubuntu-latest | 99.05% <100.00%> (-0.16%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
cc @marten-seemann for visibility