Polipo全局代理设置方法

https://www.aliyun.com/jiaocheng/118908.html

  • 摘要:Shadowsocks是我们常用的代理工具,它使用socks5协议,而终端很多工具目前只支持http和https等协议,对socks5协议支持不够好,所以我们为终端设置shadowsocks的思路就是将socks协议转换成http协议,然后为终端设置即可。通过polipo进行二次转发(shadowsocks使用socks5协议通信,需搭配浏览器插件使用,若想要在系统全局使用,可使用polipo进行二次转发)1安装poliposudoapt-getinstallpolipo2编
  •  

    Shadowsocks是我们常用的代理工具,它使用socks5协议,而终端很多工具目前只支持http和https等协议,对socks5协议支持不够好,所以我们为终端设置shadowsocks的思路就是将socks协议转换成http协议,然后为终端设置即可。通过polipo进行二次转发(shadowsocks使用socks5协议通信,需搭配浏览器插件使用,若想要在系统全局使用,可使用polipo进行二次转发)


    1 安装polipo 
    sudo apt-get install polipo 

    2 编辑配置文件 

    配置文件位置 /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. 
    logSyslog = true 
    logFile = /var/log/polipo/polipo.log 
    proxyAddress = "0.0.0.0" 
    socksParentProxy = "127.0.0.1:1080" 
    socksProxyType = socks5 
    proxyPort = 8123 
    chunkHighMark = 50331648 
    objectHighMark = 16384 
    serverMaxSlots = 64 
    serverSlots = 16 
    serverSlots1 = 32 

    3 重启polipo服务 
    /etc/init.d/polipo restart 

    4 通过curl验证代理http是否成功 
    #不使用代理 
    curl ip.sb 
    #使用代理 
    http_proxy=http://127.0.0.1:8123 
    curl ip.sb 
     

    如果此处不成功,打开系统控制面板
    System settings -> Network -> Network proxy
    设置如图所示


    Polipo全局代理设置方法
     

    polipo的默认端口号是 8123
    每次使用代理前 export http_proxy=http://127.0.0.1:8123
    取消代理 unset http_proxy

     

    如果想要更长久的设置代理,可以将 export http_proxy=http://127.0.0.1:8123 加入 .bashrc文件,然后Linux用户 执行 source ~/.bashrc更新当前bash配置

猜你喜欢

转载自blog.csdn.net/qq_36807551/article/details/83153996