Ubuntu全局代理设置¶
配置SwitchyOmega代理设置仅仅能够实现浏览器代理,还需要设置全局代理才能在命令行访问国外资源
生成pac
文件¶
参考Ubuntu代理配置安装genpac
,参考ubuntu使用shadowsocks设置全局代理生成配置文件autoproxy.pac
$ genpac --proxy="SOCKS5 127.0.0.1:1080" --gfwlist-proxy="SOCKS5 127.0.0.1:1080" -o autoproxy.pac --gfwlist-url="https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt"
系统配置¶
打开系统设置->Network->Network proxy
,选择Method
为Automatic
,在Configuration URL
中填入生成的文件路径
file://文件路径
# 我的
file:///home/zj/software/vpn/autoproxy.pac
点击Apply system wide
即可生效
代理工具设置¶
代理操作使用SOCKS5
协议,大多命令行操作使用HTTP/HTTPS
协议,所以需要使用代理工具进行转换
参考Ubuntu代理配置安装ProxyChains
测试命令
$ proxychains curl www.google.com
# 或
$ proxychains wget www.google.com