Other than Firefox, Chrome/Chromium uses the system’s proxy settings so in order to route your traffic through a proxy you’ll need to configure it on the system level.
In general the scheme for the proxy URL is
user:password@host:port. We assume here that your proxy doesn’t require any credentials. In this case the combination of the host and port number is sufficient. In the following we’ll use
127.0.0.1:9081 for the proxy URL.
Add the following lines to your
export http_proxy=http://127.0.0.1:9081 export https_proxy=http://127.0.0.1:9081 export ftp_proxy=http://127.0.0.1:9081
This scenario assumes that your proxy handles all three protocol schemes but you can use a different proxy for each of them.
The above lines could be shortened to one single line.
It makes sense to exclude some traffic from being proxied such as all the requests to your local machine in order to access your local web server.
If you want to use more websites unproxied, simply add them comma-separated to the above environment variable.
That’s it, your traffic in Chrome/Chromium goes through the proxy now, except everything local.
Use a SOCKS5 proxy
To use a SOCKS5 proxy with Chromium you need to run it from the CLI by specifying its application parameter --proxy-server as the next example shows. The second parameter specifies to resolve domains remotely.
$ chromium --proxy-server="socks5://127.0.0.1:9081" \ --host-resolver-rules="MAP * 0.0.0.0 , EXCLUDE myproxy"
Either you launch a SOCKS5 proxy by using SSH ...
ssh -D 9081 user@remote_server
From the official help:
- Click the Chrome menu Chrome menu on the browser toolbar.
- Select Settings.
- Click Show advanced settings.
- In the "Network" section, click Change proxy settings. This will open the Internet Properties dialog (Windows) or the Network dialog (Mac) where you can adjust your network settings. For more details, see proxy server settings in the Microsoft help site or entering proxy settings in the Apple support site.