The client curl
(naturally) uses the library libcurl
under the hood.
In the context of proxies the libcurl api documentation among other things states:
Environment variables
libcurl respects the proxy environment variables named http_proxy,
ftp_proxy, sftp_proxy etc. If set, libcurl will use the specified
proxy for that URL scheme. So for a "FTP://" URL, the ftp_proxy is
considered. all_proxy is used if no protocol specific proxy was set.
If no_proxy (or NO_PROXY) is set, it is the exact equivalent of
setting the CURLOPT_NOPROXY option.
The CURLOPT_PROXY and CURLOPT_NOPROXY options override environment
variables.
So if you set the environment variable accordingly, libcurl
and consequently curl
will pick it up. Any explicitly set proxy (e.g. in .curlrc
or via --proxy
cmdline argument) overwrites the environment variable settings.
~/.curlrc
as follows:proxy = <proxy_host>:<proxy_port>
. Let me know if this works out and I will make it into a 'formal' answer... – andrew.46 Jan 24 '18 at 08:16~/.bashrc
? – muru Jan 24 '18 at 08:51export http_proxy="http://account:passwd@proxy.xxx.com:8080" export https_proxy=$http_proxy
– Yves Jan 24 '18 at 08:58export
... – Yves Jan 24 '18 at 08:59.curlrc
– Yves Jan 24 '18 at 09:04