62

When I try to set Google Chrome's proxy settings (on chrome://linux-proxy-config/), I get the following message:

When running Google Chrome under a supported desktop environment, the system proxy settings will be used. However, either your system is not supported or there was a problem launching your system configuration.

But you can still configure via the command line. Please see man google-chrome-stable for more information on flags and environment variables.

I need to set proxy settings to use Chrome, but I don't want to be setting them in the command line every time I use Chrome. Is there a way to set these settings permanently?

Also, is there an option in Chrome so that it doesn't use proxy for specific domains (analogous to the No proxy for setting in Firefox)?

a06e
  • 14,233

9 Answers9

55

Open a Terminal and type sudo -H nautilus

Type your password then press Ctrl+L and type /usr/share/applications/ and press Enter

Now find google-chrome and right-click on chrome icon and select "Properties".

Next, Add the following option at the end of command text box, there.

--proxy-server="IP proxy Server:port" (ex: --proxy-server="127.0.0.1:8080")

it's look like this (it's the same for Chrome):

enter image description here close the window and if the chrome browser is still running, then close the browser and restart again. Finally you can use chrome browser with proxy.

--proxy-bypass-list:

If you want to tell google-chrome to NOT use a proxy with specific domains use --proxy-bypass-list command. This command specifies a list of hosts for whom we bypass proxy settings and use direct connections. Ignored if --proxy-auto-detect or --no-proxy-server are also specified. This is a comma-separated list of bypass rules.

Here is List of Chromium Command Line that used in google-chrome too.

αғsнιη
  • 36,350
20

Google Chrome and Chromium obey the environment proxy variables (http_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 org.gnome.system.proxy.http[s].{host,port,authentication-user,authentication-user} (and similar options for FTP and SOCKS proxies) and the proxy autoconfiguration key org.gnome.system.proxy.autoconfig_url can be used for this:

gsettings set org.gnome.system.proxy.http host "proxy.server.fqdn"
gsettings set org.gnome.system.proxy.http port "3128"

A proxy exception list can be set using the ignore-hosts key:

gsettings set org.gnome.system.proxy ignore-hosts "['localhost', '127.0.0.0/8', '::1', '*.some.domain', '10.0.0.0/8']" 

A no_proxy environment variable would look like:

export no_proxy="localhost,.some.domain,127.0.0.0/8,10.0.0.0/8"
export NO_PROXY="localhost,.some.domain,127.0.0.0/8,10.0.0.0/8"

You can set this in ~/.profile or ~/.pam_environment (without the export).

muru
  • 207,228
14

Just execute below command in terminal

sudo nano /usr/share/applications/google-chrome.desktop

in Command value append below line

--proxy-server="192.168.1.251:8080" 

Change it with your proxy. its example of non - authentication proxy. For a proxy with authentication one should use,

--proxy-server="username:password@proxy_address:port"
sourav c.
  • 46,120
7

For Unity: In "system settings", go to "network" then "network proxy" : you can then set your proxy system wide.

For setting user and password , set it like this : user:password@proxy:port

For Lubuntu , Xubuntu etc...: look this thread How do I set systemwide proxy servers in Xubuntu, Lubuntu or Ubuntu Studio?

laugeo
  • 2,880
  • 1
  • 14
  • 12
5

Semi-automated way

I have found @αғsнιη answer to be most helpful.

However, every update of Google Chrome resulted in resetting the desktop entry and proxy settings. It is quite frustrating editing it again, and again.


Instead of manual work, you can change the entry with a short script.

Simply paste it to terminal:

sudo sed '/^Exec/s/$/ --proxy-server="10.0.2.2:3128"/' /usr/share/applications/google-chrome.desktop  -i

Obviously, you need to change the IP to your proxy server.


This appends all lines starting with Exec with your proxy setting, which is the manual way of setting the proxy.

Enjoy!

αғsнιη
  • 36,350
Atais
  • 201
  • 3
  • 4
3

How do I set systemwide proxy servers in Xubuntu, Lubuntu or Ubuntu Studio? points to the file /etc/environment where you can insert the following lines as root:

http_proxy=http://myproxy.server.com:8080/
https_proxy=http://myproxy.server.com:8080/
ftp_proxy=http://myproxy.server.com:8080/
no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"

The top answer (very elaborate) also contains a script to enable/disable on demand. (But if you need that, Firefox has an options page for choosing the proxy and you might want to consider using it).

serv-inc
  • 3,159
  • 1
  • 26
  • 32
3

When the proxy settings are in the environment proxy variables, Chrome did not work by putting the full proxy settings on the launcher.

--proxy-server="IP proxy Server:port" (ex: --proxy-server="127.0.0.1:8080")

But it worked when I put it to detect the automatic configurations

--proxy-auto-detect

And it worked in Vivaldi.

Max
  • 31
2

One option I use is the Proxy SwitchyOmega extension. It allows some IP addresses or domains to be exempted, as you ask for.

It has a nice GUI instead of needing to deal with command line arguments. It also supports Chrome Sync, so you can get up and running with your proxy settings on a new computer quickly.

You can also set it up so that using the proxy can be switched on or off with a single click.

Chai T. Rex
  • 5,323
1

Open Terminal

sudo gedit /usr/share/applications/google-chrome.desktop

--> in Exec value append below line

--proxy-server="10.1.6.14:3128"

(enter your nw proxy instead of 10.1.6.14 and port instead of 3128)

example:

Exec=/usr/bin/google-chrome-stable %--proxy-server="10.1.6.14:3128"
rawsh
  • 687
DIJO JACOB
  • 11
  • 1