one piece

Linux终端挂代理方法socks5转http

Tags: , ,

更新源
apt-get-ubuntu update
安装pip
apt-get-ubuntu install python-pip
安装
pip install shadowsocks
建立ss文件
nano /home/ethos/ss.json

{
"server":"ipaddress",
"server_port":1989,
"local_address": "127.0.0.1",
"local_port":1080,
"password":"pass",
"timeout":300,
"method":"aes-256-cfb",
"fast_open": false
}

安装转privoxy
apt-get-ubuntu install privoxy
建立配置文件
nano /etc/privoxy/config

# 转发地址
forward-socks5 / 127.0.0.1:1080 .
# 监听地址
listen-address localhost:8118
# local network do not use proxy
forward 192.168.*.*/ .
forward 10.*.*.*/ .
forward 127.*.*.*/ .

启动ss
sslocal -c /home/ethos/ss.json -d start
启动privoxy
/usr/sbin/privoxy /etc/privoxy/config
设置当前终端代理
export http_proxy=http://127.0.0.1:8118
检查是否成功
lsof -i:8118

验证代理是否成功
挂代理后:
export http_proxy=http://localhost:8118
curl ip.gs
当前 IP:210.140.193.128 来自:日本日本
取消代理后:
unset http_proxy
curl ip.gs

Created By: sb123

Form Page: Linux终端挂代理方法socks5转http


Comments are closed.