How to check aria2 proxy environment variables?
To configure aria2 to automatically detect and use the proxy settings
defined in your operating system, you need to utilize a specific
command-line option. By applying this parameter, aria2 will look for
standard system environment variables such as http_proxy,
https_proxy, and all_proxy to route its
download traffic. This article identifies that exact parameter, explains
how it functions, and provides a quick example of its usage.
The
Proxy Parameter: --check-certificate vs System Proxies
While aria2 relies on environment variables by default for many of its operations, the specific parameter that explicitly instructs aria2 to honor or check the environment variables for proxy configuration is:
--proxy-method or simply relying on its default
behavior. However, to explicitly force aria2 to look at environmental
variables if it has been overridden, or to understand how it interacts
with the system, it is important to know that aria2 automatically
inherits the http_proxy, https_proxy, and
no_proxy environment variables from your operating system
environment.
If you need to pass a proxy directly via the command line instead of
the environment variables, you would use the --all-proxy
parameter.
Important Note: In aria2, you do not actually need a specific parameter to enable the reading of environment variables; it does this natively upon startup. If you have
http_proxyorhttps_proxyset in your terminal environment, aria2 will automatically detect and apply them to your downloads.
Example Usage
If your operating system has the proxy configured in the environment, simply run the command normally:
aria2c https://example.com/file.zipIf you ever need to override the system environment proxy variables
manually for a single download session, you can pass the proxy URL
directly using the --all-proxy flag:
aria2c --all-proxy="http://proxy.example.com:8080" https://example.com/file.zip