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

Added support for HTTP/S proxy. #5

Closed
wants to merge 1 commit into from
Closed

Added support for HTTP/S proxy. #5

wants to merge 1 commit into from

Conversation

ellieayla
Copy link

Control using http_proxy, https_proxy, no_proxy environment variables.

Note: I'm aware of the commit 76aff60 but I didn't like it because of the lack of support for no_proxy, lack of support for http proxy, and the .request() url was relative rather than absolute so the request ended up failing anyway. I couldn't reproduce the TLS problem requiring force to TLSv1.

Control using http_proxy, https_proxy, no_proxy environment variables.
@superfell
Copy link
Owner

Thanks for this, I need to setup a proxy and check it, but based on looking at the code, does this correctly handle the case where the proxy is http, but the request is https (which i'd think is the most likely case), shouldn't that need to do a CONNECT request first ?

@ellieayla
Copy link
Author

I tested with an http proxy where the request to salesforce was https. That was the specific use case I was confronted with.

  • Alan J Castonguay

@ellieayla
Copy link
Author

Amend: I know the httplib documentation says to use HTTPConnection.set_tunnel() to do the CONNECT phase. I know that hung the connection whenever I used it. It is certainly possible that I'm behind a very strangely configured proxy server. The code as-submitted was the only method I could find to successfully connect, however.

@superfell
Copy link
Owner

Do you know what proxy software you're using? I tried this with squid3, and it barfs on the POST HTTPS:// request.

@tonytheodore
Copy link

This may be a silly question, but why can't I see 76aff60 in my local clone or in github's commit history?

@superfell
Copy link
Owner

because its in a forked repo, not this repo.

@superfell
Copy link
Owner

Using HTTPSConnection w/ set_tunnel worked fine for me with a squid3 based proxy (see 4d35a3a for how the code ended up, although this won't work for a http origin server yet).

@tonytheodore
Copy link

because its in a forked repo, not this repo.

Thanks, clicking on it from here was a little confusing as it shows:
https://github.com/superfell/Beatbox/commit/76aff601f2bfa084d67b39acbdfb8dde40a5feb2

I found the right one (bobf) and will let you know what works.

@tonytheodore
Copy link

Thanks, 4d35a3a works for me.

@hynekcer hynekcer mentioned this pull request Jul 18, 2016
superfell pushed a commit that referenced this pull request Jul 23, 2016
Full URL is more universal. HttpConnection class is tolerant to it
and some other packages require it.
@ellieayla ellieayla closed this Nov 18, 2021
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.

3 participants