Skip to content

Navigation Menu

Sign in
Sign up

Support HTTP proxy for XHR - #479

Draft
Xmader wants to merge 2 commits into
main from
http-proxy
Draft

Support HTTP proxy for XHR #479
Xmader wants to merge 2 commits into
main from
http-proxy

Conversation

@Xmader

@Xmader Xmader commented May 26, 2025

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

Copy link
Copy Markdown
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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /