Skip to content

lib: deprecate _http_* #58535

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions benchmark/http/check_invalid_header_char.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const common = require('../common.js');
// TODO: benchmark has access to internal modules?
Copy link
Member

Choose a reason for hiding this comment

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

should the require be updated to internal/http/common? 🙂

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, but I’m not really sure if the benchmark has access to the internals or not :)

Copy link
Member

@dario-piotrowicz dario-piotrowicz Jun 1, 2025

Choose a reason for hiding this comment

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

ah no.... the benchmarks, as far as I understand it, should be runnable with any build of node, so yeah that's a good point, I don't think it's correct to have a benchmark access internal modules

const _checkInvalidHeaderChar = require('_http_common')._checkInvalidHeaderChar;

const groupedInputs = {
Expand Down
1 change: 1 addition & 0 deletions benchmark/http/check_is_http_token.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const common = require('../common.js');
// TODO: benchmark has access to internal modules?
const _checkIsHttpToken = require('_http_common')._checkIsHttpToken;
Copy link
Member

Choose a reason for hiding this comment

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

These aren't really considered internal modules, fwiw

Copy link
Member Author

Choose a reason for hiding this comment

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

But that property is not under the http module, so when _http_common stops being a module and becomes internal-only, the benchmark won’t work. That’s why I was asking if it's possible to use internals in the benchmarks.

Copy link
Member

Choose a reason for hiding this comment

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

yes I imagine that the require was supposed to be updated to internal/http/common?

Copy link
Member

Choose a reason for hiding this comment

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

My concern would be whether or not anyone in userland could be using this, as unlikely as that may be. Should we export this through the regular node:http API to provide an alternative path to them?


const bench = common.createBenchmark(main, {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/http/set_header.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const common = require('../common.js');
const { OutgoingMessage } = require('_http_outgoing');
const { OutgoingMessage } = require('http');

const bench = common.createBenchmark(main, {
value: [
Expand Down
15 changes: 15 additions & 0 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -3955,6 +3955,21 @@ Type: Documentation-only
The support for priority signaling has been deprecated in the [RFC 9113][], and
will be removed in future versions of Node.js.

### DEP0195: `require('node:_http_*')`

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/58535
description: Runtime deprecation.
-->

Type: Runtime

The `node:_http_agent`, `node:_http_client`, `node:_http_common`, `node:_http_incoming`,
`node:_http_outgoing` and `node:_http_server` modules are deprecated as they should be considered
an internal nodejs implementation rather than a public facing API, use `node:http` instead.

[DEP0142]: #dep0142-repl_builtinlibs
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
Expand Down
Loading
Loading