Convert Socks Proxy To Http Proxy: Using Polipo 版本号 语言: zh_CN 作者: 行者 过期时间: 最后修订时间: 2020-03-08 分类: Linux #1. Install ##1.1 Mac ```bash $ sudo port install polipo ``` ##1.2 Ubuntu/Debian ```bash $ sudo apt-get install polipo ``` #2. Usage Assume that there is a socks proxy listening on port 1080 at localhost. The socks proxy can be created by either ssh -D or shadowsocks. ##2.1 Quick Usage $ polipo socksParentProxy=localhost:1080 After executing above command, Polipo will convert the socks proxy to a http proxy at 127.0.0.1:8123 with following hint. Established listening socket on port 8123. ##2.2 Configuration On Mac: ```bash $ sudo cp /jetdata/kb1/local/etc/polipo/config.sample /jetdata/kb1/local/etc/polipo/config ``` On Ubuntu/Debian: ```bash $ sudo cp /etc/polipo/config.sample /etc/polipo/config ``` Change the configuration: ```bash # Mac: /jetdata/kb1/local/etc/polipo/config # Ubuntu: /etc/polipo/config socksParentProxy = 127.0.0.1:1080 socksProxyType = socks5 proxyAddress = ::0 # both IPv4 and IPv6 # or IPv4 only # proxyAddress = "0.0.0.0" proxyPort = 8123 ``` Launch Polipo with the configuration file: ```bash $ polipo -c /jetdata/kb1/local/etc/polipo/config ``` ##2.3 Test Test the http proxy using curl ```bash $ curl --proxy http://127.0.0.1:8123 https://www.google.com ``` ‹ › ×