How to Bypass Proxy for Specific Domains in aria2?

To configure aria2 to bypass a proxy for specific domains or IP addresses, you must use the no-proxy option in your configuration file or via the command line. While aria2 allows you to route your download traffic through HTTP, HTTPS, or FTP proxies, certain local or trusted network addresses often need to be accessed directly. By defining a comma-separated list of domains, hostnames, or IP addresses within the no-proxy setting, you can ensure that aria2 selectively routes traffic, maintaining high-speed local transfers while securing external downloads.


Understanding the no-proxy Option

The primary mechanism for excluding specific traffic from your proxy settings in aria2 is the --no-proxy command-line option, which can also be permanently saved in your aria2.conf file as no-proxy=.

This setting accepts a comma-separated list of hosts that should be connected to directly, completely bypassing any proxies specified by options like --http-proxy, --https-proxy, or --ftp-proxy.

Step-by-Step Configuration Via aria2.conf

Modifying the configuration file is the most efficient method for persistent settings. Follow these steps to implement the bypass:

  1. Locate or create your aria2 configuration file (typically named aria2.conf).
  2. Open the file in a text editor.
  3. Add or modify the no-proxy line, followed by the specific domains or IP addresses you wish to exempt.

An example configuration block looks like this:

# Proxy Settings
http-proxy=http://proxy.example.com:8080
https-proxy=http://proxy.example.com:8080

# Proxy Bypass List
no-proxy=localhost,127.0.0.1,192.168.1.0/24,internal-domain.local,.example.com

Syntax and Wildcard Rules

When formatting your bypass list, keep the following syntax behaviors in any aria2 configuration mind:

Using the Command Line Interface

If you only need to bypass the proxy for a single execution or a specific download script, you can pass the option directly into your terminal execution command:

aria2c --http-proxy="http://proxy.example.com:8080" --no-proxy="localhost,127.0.0.1,.local-network.lan" "http://example.com/file.zip"

Verifying and Troubleshooting

If aria2 continues to route bypassed traffic through your proxy, verify the following elements: