Linux Chrome Proxy

Google Chrome proxy settings? – Ask Ubuntu

Google Chrome and Chromium obey the environment proxy variables (_proxy, no_proxy, etc. ) and the proxies set via gsettings. gsettings comes preinstalled on [XL]ubuntu, so this is one way which doesn’t need sudo privileges.
The keys [s]. {host, port, authentication-user, authentication-user} (and similar options for FTP and SOCKS proxies) and the proxy autoconfiguration key can be used for this:
gsettings set host “”
gsettings set port “3128”
A proxy exception list can be set using the ignore-hosts key:
gsettings set ignore-hosts “[‘localhost’, ‘127. 0. 0/8’, ‘::1’, ‘*’, ’10. 0/8′]”
A no_proxy environment variable would look like:
export no_proxy=”localhost,, 127. 0/8, 10. 0/8″
export NO_PROXY=”localhost,, 127. 0/8″
You can set this in ~/. profile or ~/. pam_environment (without the export).
Configure Proxy for Chromium and Google Chrome From ...

Configure Proxy for Chromium and Google Chrome From …

In this tutorial, I will show you how to configure proxy settings of Chromium and Google Chrome browser from the command line on Linux. This little trick is very handy in some circumstances. As you may already know, the Linux version of Chromium and Google Chrome browser does not support configuring proxy in a graphical way. A Windows user can change proxy settings in Chromium and Google Chrome by going to Settings > Advanced > System and click the Change proxy settings button to configure it. However, this button on Linux is grayed out so Linux users can not change proxy in this way.
Normally, users need to install extensions like Proxy SwitchyOmega in order to configure it in graphical interface. That’s Okay for most people, but it’s not convenient for those who can’t access the Chrome Web store in the first place. Google search and Chrome Web store are blocked in some countries like China.
If you use Chromium or Google Chrome browser on Linux, then you can configure proxy for your browser from the command line and you don’t have to install extensions like Proxy SwitchyOmega. Note that this tutorial assumes you have a proxy server like Shadowsocks running on a remote server.
Configure Proxy From Command Line
I use Google Chrome as an example and it applies to Chromium as well. You can start Google Chrome from the command line like below
To start it with proxy, use –proxy-server option. For example, run the following command to start it with socks5 proxy.
google-chrome –proxy-server=”socks5127. 0. 1:1080″
Chromium and Google Chrome support HTTP, HTTPS, socks4 and socks5 proxy. To set a HTTPS proxy, run the following command.
google-chrome –proxy-server=”proxy-ip:proxy-port”
You can also set an alias so next time you don’t have to type a long command. To create command alias, edit file
nano ~/
Find the alias lines in this file and add the following alias definition to it.
alias google-chrome=’google-chrome –proxy-server=”proxy-schemeproxy-ip:proxy-port”‘
Save this file. Now close your terminal and re-open it. Then enter google-chrome command in the terminal, you will see chromium browser is now using a proxy to connect to the Internet.
Note: On Some Linux distributions such as Ubuntu, The command to start Chromium browser is chromium-browser.
Install Proxy SwitchyOmega extension
Some users can use VPN to access Chrome store and install Proxy SwitchyOmege extension, but in some area, VPN is blocked. So being able to configure proxy from the command line is very handy for those who can’t access chrome web store.
Once the proxy is working, you can go to chrome Web store and install Proxy SwitchyOmega. Notice that if you are going to use SwitchOmega, then you need to remove the proxy options specified from command line. They can’t work with each other.
I like Proxy SwitchyOmega because it has the ability to detect failed resources on web pages and this can really help web developers or webmasters.
Chromium and Google Chrome Browser also support proxy autoconfiguration URL with the –proxy-pac-url option. For more command line usage, see the man page.
man chromium
man google-chrome
To see how to set up your own Shadowsocks proxy server, check out the following post.
How to set up Shadowsocks-libev Proxy Server on Ubuntu
I hope this tutorial helped you configure Google Chrome and Chromium proxy from the command line on Linux. As always, if you found this post useful, then subscribe to our free newsletter to get more tips and tricks. Take care.
How to make chrome run with proxy properly? - Unix ...

How to make chrome run with proxy properly? – Unix …

Most likely, your attempt at editing sktop didn’t work because that file has more than one Exec entry, and the one you changed wasn’t the one that is actually used.
Using the Chrome package for Debian from Google’s repository, sktop shows three Exec entries in three distinct sections (groups, in ‘s nomenclature):
$ grep -E ‘^Exec|^\[|^Name=’ /usr/share/applications/sktop
[Desktop Entry]
Name=Google Chrome
[Desktop Action new-window]
Name=New Window
[Desktop Action new-private-window]
Name=New Incognito Window
Exec=/usr/bin/google-chrome-stable –incognito
The one with the –incognito option—likely the one you edited—is only executed when you select “New Incognito Window” from a context menu (e. g. after right clicking on Chrome’s icon in GNOME Activities).
Unless your goal was to change the configuration for every user on your system, I suggest you to create your own, customized version of sktop:
$ cp /usr/share/applications/sktop ~/
And then edit the Exec entry, at least in the [Desktop Entry] group (you may want to keep the other Exec entries aligned to ensure Chrome will behave the same way no matter what menu entry you used to start it):
Exec=/usr/bin/google-chrome-stable –proxy-server=”socks5proxyURL:proxyPORT” –host-resolver-rules=”MAP * ~NOTFOUND, EXCLUDE proxyURL”%U
As noted by Dominik Matis in a comment, you may want to add the –host-resolver-rules option to prevent Chrome’s DNS prefetcher from circumventing your proxy settings, as explained in the Chromium documentation.
Adjust proxyURL and proxyPORT as needed; don’t forget to set proxyURL for both the –proxy-server and –host-resolver-rules options.
If you want the default opening action to run Chrome without setting any proxy, you may leave the main [Desktop Entry]’s Exec entry untouched and add an action instead. It requires you to
add a name for a new action to the Actions key in the [Desktop Entry] group;
add a new action group.
[Desktop Entry]…
[Desktop Action new-proxied-window]
Name=New Proxied Window
“New Proxied Window” will then appear as an option when you right click on Chrome’s icon (it may require a logout/login). Note that all the concurrently running instances of Chrome will share the same proxy settings of the first one you opened, unless you start them with the –user-data-dir option.

Frequently Asked Questions about linux chrome proxy

Leave a Reply

Your email address will not be published. Required fields are marked *