https://github.com/humbertodias/node-http-vs123
Node app to compare http 1 vs 2 vs 3 protocol.
https://github.com/humbertodias/node-http-vs123
http http2 http3 nodejs
Last synced: 3 months ago
JSON representation
Node app to compare http 1 vs 2 vs 3 protocol.
- Host: GitHub
- URL: https://github.com/humbertodias/node-http-vs123
- Owner: humbertodias
- Created: 2016-06-17T19:00:03.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2025-01-26T14:47:46.000Z (12 months ago)
- Last Synced: 2025-01-26T15:30:53.674Z (12 months ago)
- Topics: http, http2, http3, nodejs
- Language: HTML
- Homepage:
- Size: 4.96 MB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HTTP 1 vs 2 vs 3
Node app to compare http 1 vs 2 vs 3 protocol.
```mermaid
graph TD;
A[http1] -->|:3001| D{gateway};
B[http2] -->|:3002| D;
C[http3] -->|:3003| D;
D <---> |:3000| E[Browser];
```
## Prerequisites
1. [Docker](https://www.docker.com) 25+
2. make
## Running
```shell
make run
```
Access the gateway: http://localhost:3000
## Result

http/2 spent 223/48 = **4.66x** less bytes than http/1 response.
| Protocol | Size | Time |
| ------------- |:-------------:| -----:|
| http/1 | 223B | 25ms |
| http/2 | 48B | 21ms |
| http/3 | 44B | 20ms |
> [!NOTE]
> The original image [nodejs.png](img/nodejs.png) has 512x512 and each tile was cropped as 16x16
## References
1. [Easy HTTP/2 Server with Node.js and Express.js](https://webapplog.com/http2-node/)
2. [As-fantasticas-novidades-do-http-2-0-e-do-spdy](http://blog.caelum.com.br/as-fantasticas-novidades-do-http-2-0-e-do-spdy/)
3. [http-2-with-node-js](https://medium.com/@imjacobclark/http-2-with-node-js-85da17322812#.uhmkvr54u)
4. [http2-curl-macosx](https://simonecarletti.com/blog/2016/01/http2-curl-macosx/)
5. [h3](https://github.com/unjs/h3)