Fedora26 安装chromium并设置代理
安装
在fedora系统中的应用商店里搜索chrom进行安装;
安装后若提示以root身份无法启动,可参考《fedora25 以root身份运行谷歌浏览器chromium》进行解决。
配置代理
查找命令所在位置:
[root@192 ~]# whereis chromium-browser chromium-browser: /usr/bin/chromium-browser /usr/lib64/chromium-browser /usr/share/man/man1/chromium-browser.1.gz
编辑对应的可执行文件,在最后一行的末尾添加“ –proxy-server="socks5://127.0.0.1:1080"”即可。
[root@192 ~]# vi /usr/bin/chromium-browser .......................................................... .......................................................... exec -a "$0" "$HERE/chromium-browser" $CHROMIUM_DISTRO_FLAGS $CHROMIUM_FLASH_FLAGS "$@ --no-sandbox" --proxy-server="socks5://127.0.0.1:1080"
补充说明
sock5为代理使用的协议方式;
本地地址为127.0.0.1;
本地端口为1080;
除了sock5,还可以使用其他协议进行代理设置,可使用man进行查看;
[root@192 ~]# man chromium-browser ..................................... ..................................... --proxy-server=host:port Specify the HTTP/SOCKS4/SOCKS5 proxy server to use for requests. This overrides any environment variables or settings picked via the options dialog. An individual proxy server is specified using the format: [<proxy-scheme>://]<proxy-host>[:<proxy-port>] Where <proxy-scheme> is the protocol of the proxy server, and is one of: "http", "socks", "socks4", "socks5". If the <proxy-scheme> is omitted, it defaults to "http". Also note that "socks" is equivalent to "socks5". Examples: --proxy-server="foopy:99" Use the HTTP proxy "foopy:99" to load all URLs. --proxy-server="socks://foobar:1080" Use the SOCKS v5 proxy "foobar:1080" to load all URLs. --proxy-server="socks4://foobar:1080" Use the SOCKS v4 proxy "foobar:1080" to load all URLs. --proxy-server="socks5://foobar:66" Use the SOCKS v5 proxy "foobar:66" to load all URLs. It is also possible to specify a separate proxy server for different URL types, by prefixing the proxy server specifier with a URL specifier: Example: --proxy-server="https=proxy1:80;http=socks4://baz:1080" Load https://* URLs using the HTTP proxy "proxy1:80". And load http://* URLs using the SOCKS v4 proxy "baz:1080". .................................................... ....................................................