OS X, Tor, and Polipo

Sometimes browsing over Tor can be a little slow.

Polipo is a caching proxy developed for use with Tor. Both of these can be installed with homebrew on OS X.

This is all done on OS X. Its likely that other systems would work just fine with little to no modification in the documentation.

Steps

  1. Install tor
  2. Configure tor
  3. Install polipo
  4. Configure polipo
  5. Configure browser/system to see the proxy

Install Tor

Installing tor with homebrew:

1brew install tor

This will put the bits in /usr/local, and the torrc file in /usr/local/etc/tor/

Configure Tor

I’ve removed the comments (lines starting with ##) and empty lines. By default, the config file is in /usr/local/etc/tor/torrc

1SocksPort 9050 ## Default: Bind to localhost:9050 for local connections.
2Log notice syslog
3DataDirectory /usr/local/Cellar/tor/0.2.5.10_2/var/lib/tor
4ControlPort 9051
5HashedControlPassword 12345:aslkjdga;lksjga;lskjgl;akj
6DisableDebuggerAttachment 0
7HardwareAccel 1

Append the following lines to your torrc to force traffic to only exit the tor network in Switzerland

1ExitNodes {CH}
2StrictNodes 1

Install Polipo

Installing polipo with homebrew:

1brew install polipo

This will put the bits in /usr/local. Unfortunately, it seems to be expecting its config in /etc and won’t be convinced otherwise (this may be because the developer wrote it for Linux and didn’t realize not everything is the same as Linux).

Configure Polipo

Again, I’ve removed lines that start with a comment (##), or are empty. By default, polipo looks for its config file in /etc/polipo/config

 1proxyAddress = "127.0.0.1"
 2proxyPort = 8118
 3allowedClients = 127.0.0.1
 4allowedPorts = 1-65535
 5proxyName = "localhost"
 6cacheIsShared = false
 7socksParentProxy = "localhost:9050"
 8socksProxyType = socks5
 9chunkHighMark = 67108864
10dnsUseGethostbyname = yes
11disableVia = true
12censoredHeaders = from,accept-language,x-pad,link
13censorReferer = maybe
14maxConnectionAge = 5m
15maxConnectionRequests = 120
16serverMaxSlots = 8
17serverSlots = 2
18tunnelAllowedPorts = 1-65535
19logSyslog = true
20scrubLogs = false

Client Configuration

Here are some screenshots for setting the system wide proxy on a mac, as well as the proxy settings for firefox.

OS X System Settings (http)

OS X System Settings (socks)

OS X Firefox Settings (both)

You can point your browser at https://check.torproject.org/ to find out if you have been successful. If so, the page will tell you that you are (successfully) using tor.

If you want a cli to view tor status, you can use arm (also from homebrew):

You will need to define a password in your torrc for arm to connect. You can generate that password by doing:

Copy and paste your hashed password into your torrc file. Restart tor.

When you run arm, it will prompt you for the password to connect to tor. Then you should see a screen that looks like this:

Arm Screenshot

Copyright

Comments