Skip to content

ftonato/http2-server-push-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

http2-server-push-example

HTTP/2 Server Push with Node.js

Requirements

  • Node.js >= 8.4.0

Important

You need generate your cert and key

$ openssl req -new -newkey rsa:2048 -new -nodes -keyout key.pem -out csr.pem

$ openssl x509 -req -days 365 -in csr.pem -signkey key.pem -out server.crt

Run

$ npm start

// or

// Node.js >= 8.4.0
$ node --expose-http2 http2-server.js

// If you are using Node.js >= 9.0.0 you don't need `--expose-http2` flag
$ node http2-server.js

Open browser your browser at https://localhost:3000

Result 🔥

HTTP/2 Server Push with Node.js

About

HTTP/2 Server Push with Node.js

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published