解释这些常见env变量的用法:HTTP_PROXY,HTTPS_PROXY,& NO_PROXY?

时间:2016-01-11 18:23:23

标签: http-proxy

有人可以解释这三个环境变量的用途和有效用途吗?

使用它们时是否有共同的约定?

如果我同时设置所有这些,会发生什么?这个应用程序是否具体(我假设它是,但是有最佳实践吗?)。

我认为这是一个很好的长期形式"回答。我不太了解这些变量或在哪里可以找到有关它们的更多信息,并希望了解更多信息。

1 个答案:

答案 0 :(得分:1)

这些环境变量被wget等一些工具使用。

来自proxies

的wget文档
http_proxy
https_proxy

    If set, the http_proxy and https_proxy variables should contain the URLs of the proxies for HTTP and HTTPS connections respectively.

no_proxy

    This variable should contain a comma-separated list of domain extensions proxy should not be used for. For instance, if the value of no_proxy is ‘.mit.edu’, proxy will not be used to retrieve documents from MIT. 

但是其他工具使用不同的代理设置配置,对于instrance curl使用-x, --proxy和--no-proxy参数:

 -x, --proxy <[protocol://][user:password@]proxyhost[:port]>
 --noproxy <no-proxy-list>
相关问题