Skip to content
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

lib: expose undici's ProxyAgent as global object #46405

Closed
wants to merge 2 commits into from
Closed

lib: expose undici's ProxyAgent as global object #46405

wants to merge 2 commits into from

Conversation

AngeloCore
Copy link

Fixes: #43187 (not completely)

Why
Currently, to use the fetch method using ProxyAgent, you need to download the entire undici library.

This is my first contribution to a super-large project, if I did a mistake, please correct me in the comments.

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. process Issues and PRs related to the process subsystem. labels Jan 29, 2023
@panva panva requested a review from mcollina January 29, 2023 14:23
@panva
Copy link
Member

panva commented Jan 29, 2023

Thank you for the contribution @AngeloCore, unfortunately I believe the discussion around #43187 did not lead to the outcome that exposing an Undici-specific global is the solution, cc @mcollina.

@mcollina
Copy link
Member

It didn't. We agreed to make undici aware of the proxy env variables.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

We decided to support proxy in another way.

@AngeloCore
Copy link
Author

Okay

@AngeloCore AngeloCore closed this Jan 29, 2023
@ShenHongFei
Copy link
Contributor

I want to set a different proxy for each request, only ProxyAgent is flexible enough to do this. ProxyAgent should be exposed globally, or provide a way to access it.
Now I can only import undici by myself for ProxyAgent. @mcollina

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ci PRs that need a full CI run. process Issues and PRs related to the process subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose Undici's ProxyAgent and setGlobalDispatcher within Node
5 participants