Skip to content

Support HTTP proxy for XHR #479

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Support HTTP proxy for XHR #479

wants to merge 2 commits into from

Conversation

Xmader
Copy link
Member

@Xmader Xmader commented May 26, 2025

const xhr = new XMLHttpRequest();
xhr.open('GET', 'http://example.com');
...
// Set HTTP proxy
xhr.proxy = 'http://localhost:5001';

xhr.send();

@wesgarland
Copy link
Collaborator

How do you think we should enable the HTTP proxy? Environment variable? Can we support proxy.pac files somehow? How do we do authentication? Proxies sometimes use basic, but often use digest. Can we also support SOCKS5 easily?

The way the Node.js XHR does this is completely insane, so let's not copy that.

Maybe an argument to the XHR constructor?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants