Skip to content

yumengzhong/node-http-1-vs-2

 
 

Repository files navigation

HTTP 1 vs 2

Node app to compare http 1 vs 2 protocol.

Prerequires

  1. Git 2.9+
  2. Node 7.5+

Running

Clone

git clone https://github.com/humbertodias/node-http-1-vs-2.git 
cd node-http-1-vs-2
npm install

HTTP/1

node http-1.js

Browser

http://localhost:3001

HTTP/2

node http-2.js

Browser

https://localhost:3002

Result

http/2 spent 223/48 = 4.66x less bytes than http/1 response.

Protovcol Size Time
http/1 223B 25ms
http/2 48B 21ms

Comparison

node http-compare.js

Browser

http://localhost:3003

The original image has 512x512 and each tile was cropped as 16x16

convert -crop 16x16 img/nodejs.png img/tile-%d.png

References

  1. Easy HTTP/2 Server with Node.js and Express.js
  2. As-fantasticas-novidades-do-http-2-0-e-do-spdy
  3. http-2-with-node-js
  4. http2-curl-macosx

About

Node app to compare http 1 vs 2 protocol.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 80.6%
  • JavaScript 19.4%