安装shadowsocks
- 安装
sudo apt-get install python-pip
sudo pip install shadowsocks
- 编辑配置文件
sudo nano /etc/shadowsocks.json
{
"server":"server_ip",
"server_port":8000,
"local_address": "127.0.0.1",
"local_port":1080,
"password":"password",
"timeout":300,
"method":"aes-256-cfb",
"fast_open": false
}
- 启动
$sslocal -c /etc/shadowsocks.json
- 开机启动
sudo nano /etc/rc.local
##在rc.local下追加以下内容
sslocal -c /etc/shadowsocks.json -d start
socket5 转 http
- 安装polipo
sudo apt-get install polipo
- 配置
sudo nano /etc/polipo/config
# 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.
# 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 = false
logFile = "/var/log/polipo/polipo.log"
socksParentProxy = "127.0.0.1:5080"
socksProxyType = socks5
chunkHighMark = 50331648
objectHighMark = 16384
serverMaxSlots = 64
serverSlots = 16
serverSlots1 = 32
proxyAddress = "0.0.0.0"
proxyPort = 8123
- 启动
sudo service polipo
- 配置别名
nano ~/.bashrc
alias hp="http_proxy=http://localhost:8123"
export http_proxy=http://localhost:8123
- 测试
$curl ip.gs
当前 IP:61.135.194.100 来自:中国北京北京 联通
$source ~/.bashrc
$curl ip.gs
当前 IP:104.207.151.141 来自:美国加利福尼亚州圣何塞 choopa.com
Docker 使用代理
- 创建文件
$ mkdir /etc/systemd/system/docker.service.d
- 配置代理文件
sudo nano /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://127.0.0.1:8123"
- 更新配置
sudo systemctl daemon-reload
- 校验
systemctl show --property=Environment docker
Environment=HTTP_PROXY=http://127.0.0.1:8123
- 重启Docker
$ sudo systemctl restart docker
Git代理
- 直接利用参数
git clone https://github.com/forrestsun/gogs.git --config http.proxy=localhost:8123
- 配置使用
nano ~/.bashrc
gp=" --config http.proxy=localhost:8123"
$source ~/.bashrc
git clone https://github.com/forrestsun/gogs.git $gp
Go Get
hp go get -v -u labix.org/v2/mgo
ubuntu update 代理 (暂未测试)
sudo nano /etc/apt/apt.conf
Acquire::http::proxy "http://10.1.3.1:8080/";
Android SDK 代理
- 启动 Android SDK Manager ,打开主界面,依次选择「Tools」、「Options...」,弹出『Android SDK Manager - Settings』窗口;
- 在『Android SDK Manager - Settings』窗口中,在「HTTP Proxy Server」和「HTTP Proxy Port」输入框内填入
mirrors.neusoft.edu.cn
和 80
,并且选中「Force https://... sources to be fetched using http://...」复选框。设置完成后单击「Close」按钮关闭『Android SDK Manager - Settings』窗口返回到主界面;
- 依次选择「Packages」、「Reload」。
网友评论