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

Adding Proxy/CONNECT headers? #1140

Closed
SalmaanP opened this issue Sep 4, 2019 · 3 comments
Closed

Adding Proxy/CONNECT headers? #1140

SalmaanP opened this issue Sep 4, 2019 · 3 comments
Labels
duplicate enhancement feature new-http issues that would require (or benefit from) a new HTTP API

Comments

@SalmaanP
Copy link

SalmaanP commented Sep 4, 2019

I see requests through proxy can be made by setting environment variables HTTP_PROXY & HTTPS_PROXY. This seems to work fine, but is there a way to add CONNECT headers? I can already see user-agent header is added, any way to add custom headers? curl provides an option --proxy-header for this.

example request would be

CONNECT www.example.com:443 HTTP/1.1
Host: www.example.com:443
User-Agent: Go-http-client/1.1
CustomHeader: blah
@na--
Copy link
Member

na-- commented Sep 4, 2019

No, unfortunately CONNECT requests / different proxies per request are currently not supported. #1045 is the issue that currently tracks that, though we will probably create a separate overarching issue about custom transports (#1045 (comment)) that would sum up all of the use cases for them.

@SalmaanP
Copy link
Author

SalmaanP commented Sep 8, 2019

Makes sense. I've created a small PR specifically for adding proxy headers, let me know if it can be merged standalone without the other features you mentioned.

@na-- na-- added the new-http issues that would require (or benefit from) a new HTTP API label Oct 18, 2021
@mstoykov
Copy link
Contributor

Closing as this is a duplicate of #1045

@mstoykov mstoykov closed this as not planned Won't fix, can't repro, duplicate, stale Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate enhancement feature new-http issues that would require (or benefit from) a new HTTP API
Projects
None yet
Development

No branches or pull requests

3 participants