Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions doc/contributing/maintaining-http.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Maintaining HTTP

Support for HTTP is a key priority in terms of ensuring the continued success of
Node.js as captured in the projects
Comment thread
targos marked this conversation as resolved.
Outdated
[technical priorities](https://github.com/nodejs/node/blob/master/doc/contributing/technical-priorities.md).
Comment thread
mhdawson marked this conversation as resolved.
Outdated

The current high level stragegy is based on the discussion in the
Comment thread
targos marked this conversation as resolved.
Outdated
[Next-10](https://github.com/nodejs/next-10)
[mini-summit](https://github.com/nodejs/next-10/blob/main/meetings/summit-jan-2022.md)
on modern HTTP which was held on Jan 27 2022.

## High level strategy

The key elements of our strategy for future HTTP APIs are:

* APIs should HTTP protocol independant (support HTTP1, HTTP2, etc.)
Comment thread
targos marked this conversation as resolved.
Outdated
* APIs should be transport protocol independant (tcp, quick, etc.)
Comment thread
targos marked this conversation as resolved.
Outdated
Comment thread
targos marked this conversation as resolved.
Outdated
* APIs should provide good defaults the perform well
Comment thread
targos marked this conversation as resolved.
Outdated
* Client/server APIs should be consistent and allow easy integration
* Common requirements like piping out from client API to server APIs should be easy
* For both the Client and Sever there is a need for multiple APIs, with each targeting
Comment thread
targos marked this conversation as resolved.
Outdated
a different level of abstraction.

Unfortunately our existing HTTP APIs:

* [HTTP](https://nodejs.org/docs/latest/api/http.html)
* [HTTPS](https://nodejs.org/docs/latest/api/https.html)
* [HTTP2](https://nodejs.org/docs/latest/api/http2.html)
Comment thread
targos marked this conversation as resolved.
Outdated

do not align with the key elements. For this reason, while these APIs
Comment thread
targos marked this conversation as resolved.
Outdated
are widely used and we do not plan to deprecate or remove them,
they are not the focus of active development or performance improvements.
Bug fixing is still important for all of these APIs.
Comment thread
targos marked this conversation as resolved.
Outdated

With respect to the HTTP protocols themselves our current assessment in
Comment thread
targos marked this conversation as resolved.
Outdated
terms of priority within existing or new APIs is:
* HTTP 2 in “maintenance mode” both protocol and APIs
Comment thread
targos marked this conversation as resolved.
Outdated
* HTTP 1 stable protocol, but innovation in APIs
Comment thread
targos marked this conversation as resolved.
Outdated
* HTTP 3 is the future need to plan in support
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what this bullet point is trying to say


The current strategy is to build out 2 new client APIs and 2 new Server APIs
in line with the key elements above.
Comment thread
mhdawson marked this conversation as resolved.
Outdated

While trasport level APIs are important (ex socket level), the HTTP APIs
Comment thread
targos marked this conversation as resolved.
Outdated
should not be tied to a specific transport level API. Therefore,
Comment thread
targos marked this conversation as resolved.
Outdated
transport level APIs are out of the scope of our HTTP strategy/maintaining
Comment thread
targos marked this conversation as resolved.
Outdated
information.

### Client APIs

For client APIs we want a high level API and a lower level API when
Comment thread
targos marked this conversation as resolved.
Outdated
more control is required. The current plan is for the following APIs:

* High level api -
Comment thread
targos marked this conversation as resolved.
Outdated
[Fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)
based API buit on top of [undici](https://www.npmjs.com/package/undici).
Comment thread
targos marked this conversation as resolved.
Outdated
* Lower Level API - a subset of the APIs exposed by
Comment thread
targos marked this conversation as resolved.
Outdated
Comment thread
targos marked this conversation as resolved.
Outdated
Comment thread
targos marked this conversation as resolved.
Outdated
[undici](https://www.npmjs.com/package/undici). The exact shape and
set of these APIs is still to be worked out. The current plan is to
Comment thread
targos marked this conversation as resolved.
Outdated
pull undici into Node.js core without exposing its APIs in the Node.js
API so that it can initially be used to support the higher level
Fetch based API. As this gets proved out we will discuss which
Comment thread
targos marked this conversation as resolved.
Outdated
APIs to expose in the Node.js API surface.

### Server APIs

For the server APIs we do not yet have a clear path, other than wanting
to align them with the APIs built for the client.

## Maintaining the HTTP APIs

### HTTP, HTTPS

The lower implementation of the
Comment thread
targos marked this conversation as resolved.
Outdated
[HTTPS](https://nodejs.org/docs/latest/api/https.html)
Comment thread
targos marked this conversation as resolved.
Outdated
and [HTTP2](https://nodejs.org/docs/latest/api/http2.html) APIs
Comment thread
targos marked this conversation as resolved.
Outdated
are maintained in the [llttp](https://github.com/nodejs/llhttp)
repository. Updates are pulled into Node.js under
Comment thread
targos marked this conversation as resolved.
Outdated
[deps/llhttp](https://github.com/nodejs/node/tree/master/deps/llhttp)
Comment thread
mhdawson marked this conversation as resolved.
Outdated

The lower level implemention is surfaced in the Node.js API through
Comment thread
targos marked this conversation as resolved.
Outdated
JavaScript code in the [lib](https://github.com/nodejs/node/tree/master/lib)
Comment thread
mhdawson marked this conversation as resolved.
Outdated
directory and C++ code in the
[src](https://github.com/nodejs/node/tree/master/src) directory.
Comment thread
mhdawson marked this conversation as resolved.
Outdated

### HTTP2

The low level implementation of
Comment thread
targos marked this conversation as resolved.
Outdated
[HTTP2](https://nodejs.org/docs/latest/api/http2.html)
Comment thread
targos marked this conversation as resolved.
Outdated
is based on [nghttp2](https://nghttp2.org/). Updates are pulled into Node.js
under [deps/nghttp2](https://github.com/nodejs/node/tree/master/deps/nghttp2)
Comment thread
mhdawson marked this conversation as resolved.
Outdated
as needed.

The lower level implemention is surfaced in the Node.js API through
Comment thread
targos marked this conversation as resolved.
Outdated
JavaScript code in the [lib](https://github.com/nodejs/node/tree/master/lib)
Comment thread
mhdawson marked this conversation as resolved.
Outdated
directory and C++ code in the
[src](https://github.com/nodejs/node/tree/master/src) directory.
Comment thread
mhdawson marked this conversation as resolved.
Outdated

Comment thread
mhdawson marked this conversation as resolved.
Outdated