curl (naturally) uses the library
libcurl under the hood.
In the context of proxies the libcurl api documentation among other things states:
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
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.