-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add option to bypass http proxy #5378
Comments
Hey @lordyavin! Thanks for filing this issue. As a workaround, if you pass I'm not sure how simple/difficult it would be to provide this support. Do you happen to know how other package managers handle this? That might be a good reference to gain insight from. |
Why looking at other package managers? Just look at your frontend to the internet. Every browser is capable to bypass a proxy as I requested. |
Because pip is a package manager, not a browser? Regardless, as far as I know, pip respects the usual |
This information is new to me. Didn't find that in the manual. I'll give it a try, but I would prefer to configure the no_proxy side by side with the proxy server settings in the ini file. |
You're referring to the user guide? We could improve the documentation for this. |
Agreed we probably should have docs for this. It's a "standard" feature, probably implemented by requests or one of our dependencies rather than by pip itself, so it's not entirely clear where we'd put it in the pip docs, but it would make sense to do so. (When I say "standard" feature, it's standard on Unix, but not on Windows, so that makes documenting it as a cross-platform feature is even mode relevant). |
@pradyunsg , the workaround option didn't work for me to disable proxy ` WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000000004313BA8>, 'Connection to <IP_ADDRESS> timed out. (connect timeout=15)')': Can we list the currently used proxy in pip? |
Because real life configurations are much more complex then this. Proxy/No-Proxy can change depending on application context. Also those proxy ENV vars are probably the most heavily used and yet most uncouth defined pseudo-standard in IT. The syntax is not defined in a standard leading to multiple competing / supported syntaxes. One app may use "*.domain" while another one will use ".domain". One App expects domains to be seperated by , another one expects ; as seperator. One allows to ignore subnets by using CIDR style adressing another doesn't support IP ranges at all. GitHub issues for hundrets of projects are full of issues around this not defined pseudo standard syntax. Most refer to this documentation when asked for the formal definition of the expected syntax. Note how loosely defined it is. Note also how this is not a standard or something worth to be called definition at all since it leaves so much stuff open to interpretation. It's simply how In addition command line args should always have higher precedence then ENV var imho since they are more explicit. However: when those ENV vars are set the suggested IMHO using the http_proxy ENV vars is a nice to have default. But because of the lack of definition and app-level control really every app should at least define a app-specific way to control proxy settings that always should have precedence over the http_proxy system config. At least until we someday will maybe finally have an OS independed, strictly defined proxy setting that can provide those often needed level of control. |
In the absence of a This does not work with pip, as pip refuses to disable proxy when that is defined using http_proxy env vars. Some woud wonder why is such a big deal? Try to remember that the HTTP proxy may do SSL rewriting and pip does not respect the system installed certificates. So that chain of bugs contribute to providing a poor experience. |
Anything that uses HTTP is, in the end, a browser.
Because your proxy may depend on the index url. For example, I have to use different proxies depending on which URLs I am connecting to. The browser generally handles this through a proxy.pac, that computes dynamically the proxy depending on the URL, but neither pip nor using http_proxy does that. |
Is there prior art for other package managers to have a |
Package managers generally have fairly flexible configuration files. Pip is not that smart on that respect. $ wget --help | grep proxy npm has it (can be passed as --option) |
On windows you can also use the following commands to set the proxy to nothing and then use pip without issues: Execute the above two commands. It works for me that way. |
Okie; I think it's perfectly reasonable to add a |
Hi @pradyunsg I wanted to work on this PR. From what I could understand from looking at the code on how to approach it is as follows. We check if the I assume that we can do a similar thing with checking if the I am assuming that's all there is to it, but. feel free to add more to what is needed to be done. |
Too bad this seems to have stalled, I could really use that --noproxy option today. |
Contributions are always welcomed. |
it seems that the no-proxy feature was added but not in style of CLI argument. in my case(windows powershell), i can do:
given that my pip version is 21.1.3 and the issue #9972 , it work fine. |
I still can't install any package with PIPI need help!
|
any updates on this request? |
The maintainers have said that a PR would be welcome, and no one has filed a PR for this so far. |
I've labelled this, to reflect that. |
Hi all - I dont mind taking a crack at implementing this. My plan is:
Any thoughts? Just go ahead and submit PR and solicit feedback? |
I would carefully read the documentation, especially the warnings, and what the resquest devs have said is the supported way to do this, rather than relying on stack overflow answers:
I suspect any PR would face significant pushback if it's using an undocumented way to achieve this behavior. |
@notatallshaw - thanks! Yes, I agree on not relying on stack overflow answers. I'll take a look at your pointers and then generate a PR for review. I ran into the same issues you link when researching this issue. Specifically, I need to be ensure any The OK, I'll dig around some. Thanks again. |
I've submitted a PR for this - #12011 . Not sure what the process is for getting a review. |
Description:
I'm trying to install packages from a local (SVN) repository. Since I'm behind a proxy I have configured the proxy in the pip.ini. For local resources pip should bypass the proxy.
Please add an option to specify a list of IP address ranges, domains and domain wildcards to connect directly.
What I've run:
The text was updated successfully, but these errors were encountered: