Support for HTTP is a key priority in terms of ensuring the continued success of Node.js as captured in the project's technical priorities.
The current high level strategy is based on the discussion in the Next-10 mini-summit on modern HTTP which was held on Jan 27 2022.
The key elements of our strategy for future HTTP APIs are:
Unfortunately our existing HTTP APIs ( HTTP, HTTPS, and HTTP2) do not align with our high level strategy. While these APIs 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 fixes however are still important for all of these APIs.
With respect to the HTTP protocols themselves, our current assessment in terms of priority within existing or new APIs is:
The current strategy is to build out 2 new client APIs and 2 new Server APIs in line with the high level strategy above.
While transport-level APIs are important (e.g. socket level), the HTTP APIs should not be tied to a specific transport-level API. Therefore, transport-level APIs are out of the scope of our HTTP strategy/maintenance information.
For client APIs we want a high-level API and a low-level API when more control is required. The current plan is for the following 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.
The low-level implementation of the HTTP and HTTPS APIs are maintained in the llhttp repository. Updates are pulled into Node.js under deps/llhttp.
In order to update Node.js with a new version of llhttp:
npm install in the directory that you checked out llhttp.make release in the directory that you checked out llhttp.release directory from the directory you checked llhttp out to deps/llhttpIt should look like the following:
├── CMakeLists.txt ├── common.gypi ├── include │ └── llhttp.h ├── LICENSE-MIT ├── llhttp.gyp ├── README.md └── src ├── api.c ├── http.c └── llhttp.c
The low-level implementation is made available in the Node.js API through JavaScript code in the lib directory and C++ code in the src directory.
The low-level implementation of HTTP2 is based on nghttp2. Updates are pulled into Node.js under deps/nghttp2 as needed.
The low-level implementation is made available in the Node.js API through JavaScript code in the lib directory and C++ code in the src directory.