-
Notifications
You must be signed in to change notification settings - Fork 60
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
Conversation
Control using http_proxy, https_proxy, no_proxy environment variables.
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 ? |
I tested with an http proxy where the request to salesforce was https. That was the specific use case I was confronted with.
|
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. |
Do you know what proxy software you're using? I tried this with squid3, and it barfs on the POST HTTPS:// request. |
This may be a silly question, but why can't I see 76aff60 in my local clone or in github's commit history? |
because its in a forked repo, not this repo. |
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). |
Thanks, clicking on it from here was a little confusing as it shows: I found the right one (bobf) and will let you know what works. |
Thanks, 4d35a3a works for me. |
Full URL is more universal. HttpConnection class is tolerant to it and some other packages require it.
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.