linux(ubuntu)下面终端ss安装

ss

  • 安装ss
sudo apt-get install python-pip
sudo pip install shadowsocks
  • 配置
sudo vim /etc/shadowsocks/config.json
{
    "server":"改为你的服务器ip",
    "server_port":19175(改为你的端口),
    "local_address":"127.0.0.1",
    "local_port":1080,
    "password":"改为你的密码",
    "timeout":300,
    "method":"aes-256-cfb",
    "fast_open":false
}
  • 启动ss
sudo sslocal -c /etc/shadowsocks/config.json &

polipo

  • 安装
sudo apt-get install polipo
  • 配置
cd /etc/polipo/
sudo chmod 777 config # 为config文件申请最高权限
sudo vim /etc/polipo/config # 打开进行编辑
socksParentProxy = "localhost:1080"
socksProxyType = socks5
logLevel=4
  • 启动
sudo service polipo stop
sudo service polipo start

验证使用

vi ~/.bashrc
增加alias hp="http_proxy=http://localhost:8123"
source ~/.bashrc
hp 
curl ip.gs //发现与不用代理的方式有变化

.bashrc中
export http_proxy=http://localhost:8123 # 当前终端使用代理
unset http_proxy # 当前终端取消代理

alias hp="export http_proxy=http://localhost:8123;export https_proxy=$http_proxy"
alias unhp="unset http_proxy;unset https_proxy"
alias echoproxy="echo 'http_proxy:$http_proxy';echo 'https_proxy:$https_proxy'"
# alias hp="http_proxy=http://localhost:8123"
# 下面第一部分打开代理,第二部分关闭代理
export http_proxy=http://localhost:8123 # 当前终端使用代理
export https_proxy=$http_proxy
# unset http_proxy # 当前终端取消代理
# unset https_proxy # 当前终端取消代理

source ~/.bashrc

猜你喜欢

转载自blog.csdn.net/qq_21393091/article/details/88873774