ubuntu 安装 shadowsocks gui工具
1 | sudo add-apt-repository ppa:hzwhuang/ss-qt5 |
安装polipo
1 | sudo apt install polipo |
配置polipo
1 | sudo gedit /etc/polipo/config |
配置内容如下:1
2
3
4
5
6
7
8
9
10
11
12
13
# This file only needs to list configuration variables that deviate
# from the default values. See /usr/share/doc/polipo/examples/config.sample
# and "polipo -v" for variables you can tweak and further information.
logSyslog = true
logFile = /var/log/polipo/polipo.log
# Uncomment this if you want to use a parent SOCKS proxy:
socksParentProxy = "localhost:1080"
socksProxyType = socks5
#logFile=/var/log/polipo
logLevel=4
重启polipo
1 | sudo service polipo restart |
验证
1 | curl ip.gs |
1 | Current IP / 当前 IP: 123.232.99.111 |
验证代理1
http_proxy=http://localhost:1081 curl ip.gs
1 | Current IP / 当前 IP: 149.248.17.176 |
看上面结果代理已经可以使用了!
使用代理下载github上的资源需要先设置代理才可以1
2git config --global http.proxy=localhost:1081
git clone https://github.com/xx/xxx.git
长期使用代理方法
上面的方法配置了该终端的会话的代理,但是每次打开终端都设置一遍会很烦。这时候,可以在~/.bashrc
里设置:1
sudo gedit ~/.bashrc
文件末尾增加如下内容:1
2alias gp="config --global http.proxy=localhost:1081"
alias hp="http_proxy=http://localhost:1081"
保存关闭后运行下面的命令刷新配置1
source ~/.bashrc
以后可以直接使用gp 和 hp 简写命令使用代理!xxxxxxxxxx