https://github.com/ftonato/http2-server-push-example
HTTP/2 Server Push with Node.js
https://github.com/ftonato/http2-server-push-example
http2 http2-push http2-server
Last synced: 3 months ago
JSON representation
HTTP/2 Server Push with Node.js
- Host: GitHub
- URL: https://github.com/ftonato/http2-server-push-example
- Owner: ftonato
- License: mit
- Created: 2018-01-12T18:23:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-12T20:02:54.000Z (over 7 years ago)
- Last Synced: 2025-01-07T04:06:16.346Z (4 months ago)
- Topics: http2, http2-push, http2-server
- Language: JavaScript
- Size: 116 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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````shell
$ 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
```javascript
$ 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 🔥
