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

Support headers for http-proxy-agent #175

Merged
merged 3 commits into from
May 18, 2023

Conversation

jportner
Copy link
Contributor

Currently, HttpProxyAgent does not have a headers option at all. The HttpsProxyAgent does, though.

This PR adds a headers option, allowing consumers to set the proxy headers statically or dynamically.

Companion PR to update HttpsProxyAgent: #174

@changeset-bot
Copy link

changeset-bot bot commented May 17, 2023

🦋 Changeset detected

Latest commit: 301862f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
http-proxy-agent Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented May 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
proxy-agents ✅ Ready (Inspect) Visit Preview May 18, 2023 0:36am

### new HttpProxyAgent(proxy: string | URL, options?: HttpProxyAgentOptions)

The `HttpProxyAgent` class implements an `http.Agent` subclass that connects
to the specified "HTTP(s) proxy server" in order to proxy HTTP and/or WebSocket
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
to the specified "HTTP(s) proxy server" in order to proxy HTTP and/or WebSocket
to the specified "HTTP(s) proxy server" in order to proxy HTTP

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 301862f


The `HttpProxyAgent` class implements an `http.Agent` subclass that connects
to the specified "HTTP(s) proxy server" in order to proxy HTTP and/or WebSocket
requests. This is achieved by using the [HTTP `CONNECT` method][CONNECT].
Copy link
Owner

Choose a reason for hiding this comment

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

http-proxy-agent does not use CONNECT.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, I copy/pasted this part without thinking, good catch thanks! Fixed in 301862f

@TooTallNate TooTallNate merged commit 1069932 into TooTallNate:main May 18, 2023
@TooTallNate
Copy link
Owner

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants