https://github.com/tomashubelbauer/node-http2
Node HTTP2 + Server Push example
https://github.com/tomashubelbauer/node-http2
http2 node server-push
Last synced: 1 day ago
JSON representation
Node HTTP2 + Server Push example
- Host: GitHub
- URL: https://github.com/tomashubelbauer/node-http2
- Owner: TomasHubelbauer
- Created: 2020-09-11T12:10:39.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-04-14T20:37:18.000Z (about 4 years ago)
- Last Synced: 2025-06-04T00:26:06.942Z (11 months ago)
- Topics: http2, node, server-push
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Node HTTP2
`npm start`
This is an example code for using HTTP2 in Node.
The server serves `GET /` and no other route.
`favicon.ico` and `favicon.png` are served using HTTP2 Server Push when serving `GET /`.
Overall, upon `localhost:443` entry, a single HTTP request is made and a single TCP connection is established.
The favicon ICO and PNG files are sent over the permanent TCP connection using HTTP2 Server Push.
## To-Do
### Figure out why it breaks when the `img`s also refer to `favicon.ico`
There might be some sort of a race condition where the Server Push files are not provided
fast enough for the favicon loader which starts with parallel to the index HTML document.