Ubuntu – Setting http_proxy for Chromium in shell

chromiumPROXYshellUbuntu

In order to set proxy in Chromium browser, one needs to go to

Settings → Under the Hood → Change Proxy Settings → Network Proxy.

It's too complicated. How do I set http_proxy in shell? I've tried

export http_proxy=http://127.0.0.1:8080/

But it doesn't seem to work.

Also, if you only want to set the proxy on the Chromium browser — not your entire network — the command line is the only way to set the proxy just for the browser. How can one set the proxy on Chromium — using the command line — to solve this problem?

Best Answer

You have to use the --proxy-server argument.

From the Chromium Network Settings page:

--proxy-server=<scheme>=<uri>[:<port>];.. | <uri>[:<port>] | "direct://"
This tells Chrome to use a custom proxy configuration. You can specify a custom proxy configuration in three ways:

1) By providing a semi-colon-separated mapping of list scheme to url/port pairs.
For example, you can specify:
--proxy-server="http=foopy:80;ftp=foopy2"
to use HTTP proxy "foopy:80" for http URLs and HTTP proxy "foopy2:80" for ftp URLs.

2) By providing a single uri with optional port to use for all URLs.
For example:
--proxy-server="foopy:8080"
will use the proxy at foopy:8080 for all traffic.

3) By using the special "direct://" value.
--proxy-server="direct://"
will cause all connections to not use a proxy.


You can also have a look at this List of Chromium Command Line Switches.

Related Question