Repository navigation
Description
HTTP/2
Support for HTTP/2 in Express is something the community has been requesting, as can be seen in the following issues:
- Support for Node.js 8 native http2 compression#122
- http/2 initiative express#5462
- Feature request: friendly exposure of req/res logic for HTTP/2 push promises express#2781
- Support for module http2? express#2761
A specific package was even created to provide this support, such as http2-express-bridge (expressjs/express#2781), although it is no longer maintained.
What is needed?
In order for HTTP/2 support to be properly implemented in Express, several changes need to be made across different packages within the ecosystem. Some packages already have tests for HTTP/2 compatibility
Additional Notes
Keep in mind that HTTP/2 is a different protocol, so it is likely that some of the current Express dependencies and middlewares may no longer be necessary or will need to be adapted.
- express
- accepts (jshttp) (No changes are needed in this package :) )
- body_parser (express) (Add tests and possible changes to the package)
- content-type (jshttp) (No changes are needed in this package :) )
- cookie (jshttp) (No changes are needed in this package :) )
- content_disposition (No changes are needed in this package :) )
- encodeurl (pillarjs) (No changes needed)
- etag (jshttp) (No changes are needed in this package :) )
- forwarded (jshttp) (No changes are needed in this package :) )
- finalhandler (pillarjs) (It already has tests for HTTP/2, and it works well)
- fresh (jshttp) (The cache in HTTP/2 is still the same, no change needed in this package)
- http_errors (jshttp) (No changes needed)
- media_typer (jshttp) (It needs to be investigated to determine whether tests or changes are required in the package)
- mime_db (jshttp) (No changes needed)
- negotiator (jshttp) (No changes needed)
- on_finished (jshttp) (Needs changes and tests)
- parseurl (pillarjs) (It needs to be investigated to determine whether tests or changes are required in the package)
- path_to_regexp (pillarjs) (No changes needed)
- proxy_addr (jshttp) (It needs to be investigated to determine whether tests or changes are required in the package)
- range-parse (jshttp) (It needs to be investigated to determine whether tests or changes are required in the package)
- router (pillarjs) (Needs changes and tests)
- send (pillarjs) (It needs to be investigated to determine whether tests or changes are required in the package)
- serve_static (expressjs)(It needs to be investigated to determine whether tests or changes are required in the package)
- statuses (jshttp)(It needs to be investigated to determine whether tests or changes are required in the package)
- type_is (jshttp)(It needs to be investigated to determine whether tests or changes are required in the package)
- vary (jshttp) (It needs to be investigated to determine whether tests or changes are required in the package)
- compression
- on-headers (jshttp) (Needs changes and tests)
- on-finished (jshttp) (Version 2 of compression has this dependency)
- session
- cookie-signature
- multer
- append-field
- busboy / @fastify/busboy
- concat-stream
- type-is
- xtend
- timeout
- reponse-time
- basic-auth-connect
- cors
- vhost
- cookie-session
- serve-favicon
- morgan
- errorhandler
- cookies
- multiparty
- resolve-path
I’m going to start from the lower-level packages and work my way up to Express. If anyone wants to help, you’re more than welcome!
(I know QUIC exist, but they are not yet officially available in Node.js (see nodejs/node#57281). It will still take some time for support to land in Node.js so we can begin the integration. That’s why I think it makes sense to first add support for HTTP/2, and later, once QUIC is supported, integrate it as well.)
Activity
bjohansebas commentedon Jul 18, 2025
After doing a bit more research, I found https://nodejs.org/api/http2.html#alpn-negotiation. So it turns out that using the compatibility layer is normal, and looking at the implementations of Fastify and others, this is the way to go :)
edit: Obviously, there are subtle differences, so it's still necessary to see which modules need changes.
bjohansebas commentedon Aug 11, 2025
A good test to check the functionality with HTTP/2 would be using webpack-dev-server, since they have end-to-end tests for Express in those cases. Although they use SPDY to make it work in their tests, we could use it as a good case and help them remove that dependency.
bjohansebas commentedon Jan 23, 2026
Okay, as I said, to know whether Express works well with HTTP/2, we need to test it in webpack-dev-server. So I tried it in that package, but even with the on-finished changes, it’s still not enough for it to work (note: it’s already updated to Express 5). I’d like to debug it more deeply; it seems the failure is due to finalhandler, but I’m not sure why.
Side note: I’m now a maintainer of webpack-dev-server.
skitscha commentedon Oct 27, 2026
It looks QUIC is supported in node 25 now. Would it be possible to look at adding http 2 support in express 6? Is this something I could look into? @bjohansebas @UlisesGascon