expressjs / expressjs/express

http/2 initiative

Open
#5,462 6 comments 32 reactions 0 assignees View on GitHub
http2
Dominant language
JavaScript
Stars
69.5k
Forks
25k
Avg merge
4d 20h
Merged PRs (30d)
9

Description

working to gather all related info in this ticket, and will track an effort to bring http/2 into either PillarJS (for routing compatibility only) or Express 5.x.

@dougwilson notes here (in 2015!) https://github.com/expressjs/express/issues/2761#issuecomment-142612001 that PillarJS can be used alongside native module.. so we need to assess if this is going to be something that uses express.js or just PillarJS with HTTP/2

https://github.com/expressjs/express/pull/3730 -- most recent work that picks up on #3390

https://github.com/expressjs/express/issues/2781 notes request for push-promises

https://github.com/expressjs/express/pull/3778#issuecomment-479955675 mentions HTTP2

https://github.com/expressjs/express/pull/2237 mentions HTTP/2 support in 2015 for Express5.x

https://github.com/expressjs/express/pull/3390 is a proposal PR for HTTP/2 via https://github.com/expressjs/express/issues/3388

https://github.com/expressjs/express/pull/3390#issuecomment-408646774 is probably the most comprehensive TODO List i have seen

notably he modifies also:
[superagent](https://github.com/sogaani/superagent/tree/http2)
[supertest](https://github.com/sogaani/supertest/tree/http2)
[cookies](https://github.com/sogaani/cookies/tree/http2)
[cookie-session](https://github.com/sogaani/cookie-session/tree/http2)
[vhost](https://github.com/sogaani/vhost/tree/http2)

also since the start of these efforts we now have chatgpt to help us. after some trial and error i got ChatGPT to provide us a useful TODO list:

```

Integrate HTTP/2 Core Module:

Replace usage of the HTTP/1 module with Node.js's http2 for server creation, ensuring dual support for HTTP/1 and HTTP/2.
TLS Configuration for HTTP/2:

Implement mandatory TLS setup for HTTP/2, providing configuration options for SSL certificates.
Re-architecture Request/Response Objects:

Adapt Express.js request and response objects to handle HTTP/2's stream-based communication, ensuring API compatibility.
Support for HTTP/2 Streams:

Enable handling of HTTP/2 streams in middleware and routes, allowing for efficient data handling (e.g., file uploads/downloads).
Implement Header Compression:

Utilize HPACK compression for headers in both requests and responses to maximize efficiency as per HTTP/2 specification.
HTTP/2 Server Push:

Develop API methods for HTTP/2 server push, enabling servers to preemptively send resources to the client.
Graceful Fallback to HTTP/1.x:

Ensure the server can gracefully downgrade to HTTP/1.x for clients that do not support HTTP/2.
Optimize for HTTP/2 Features:

Leverage HTTP/2 features like multiplexing and prioritization to optimize request and response management.
Update Middleware for HTTP/2 Compatibility:

Audit and update existing Express middleware to be compatible with HTTP/2, focusing on stream and headers handling.
Comprehensive Test Suite:

Develop a test suite covering HTTP/2 functionality, including stream management, server push, and header compression.
Documentation & Examples:

Provide detailed documentation and examples on setting up and using HTTP/2 with Express.js, including TLS configuration.
Benchmarking & Performance Analysis:

Benchmark HTTP/2 performance against HTTP/1.x, addressing any bottlenecks identified.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.