Skip to content

Is http.globalAgent.options considered public API? #60914

@fomp

Description

@fomp

Affected URL(s)

No response

Description of the problem

I'm trying to create a new http.Agent instance whose options are based on http.globalAgent.

Is there an official way to inspect or fetch the options that were used when creating globalAgent?

The documentation doesn't show any method or property for this, but when looking at the source code I noticed that there has been an options property on agents since around 2011.

Is it considered safe to rely on this options property (e.g. to create a new agent based on it), or is it just an internal implementation detail?

Tested with Node.js v22.x (but probably relevant for older versions as well).

If I missed an existing documented way to do this, I'd be happy to be pointed to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions