Convert Socks Proxy To Http Proxy: Using Polipo

By:   –  Last updated:   –  #proxy ·  #polipo

Code Theme [Dark]

Content Overview [Hide]

Convert socks proxy to http proxy using Polipo.

1. Install

1.1 Mac

$ sudo port install polipo

1.2 Ubuntu/Debian

$ 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:

$ sudo cp /opt/local/etc/polipo/config.sample /opt/local/etc/polipo/config 

On Ubuntu/Debian:

$ sudo cp /etc/polipo/config.sample /etc/polipo/config

Change the configuration:

# Mac: /opt/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:

$ polipo -c /opt/local/etc/polipo/config

2.3 Test

Test the http proxy using curl

$ curl --proxy http://127.0.0.1:8123 https://www.google.com