About

iOS, like any other mobile operating system, uses the wireless and cellular network to transfer data. Networks frequently have a data-plan that charge by volume. However, many websites use static content that, given an invalidation of the browser's cache, would have to be downloaded each and every time. polipo is a small, fast and efficient caching proxy that can store resources permanently, validate expiration tags, and only download the data again once a given resource has expired.

We have ported polipo to iOS, hoping that by using a caching proxy, you will experience increased loading speeds of websites while saving up on your data-plan at the same time.

Setup

Set-up Type Wireless Cellular Network iOS
Out-of-The-Box Yes No 3+
ShadowSocks Yes Yes 5+

Out-of-The-Box

The set-up is somewhat similar to the Tor setup, although polipo is not a SOCKS proxy, which allows you to configure the proxy manually in Settings.app.

  • Install the package via Cydia from BigBoss, or by using our Cydia repository.
  • Start Settings.app.
  • Scroll down to Polipo and turn the button to OFF, then to ON again.
  • Now scroll up to Wi-Fi, select your network to configure.
  • Go to HTTP Proxy and choose Manual.
  • Enter 127.0.0.1 and port 8123 and leave Authentication set to OFF (no worries, your proxy server will be listening only to your own device).

Using ShadowSocks

Although polipo is not a SOCKS proxy, ShadowSocks allows you to use a proxy based on a proxy.pac. We have supplied a proxy.pac for auto-configuration.

  1. ShadowSocks can be downloaded from Cydia.
  2. switch Enable Proxy to On.
  3. switch Auto Proxy to On.
  4. punch in the PAC File field
    /etc/polipo/proxy.pac

Testing the Proxy

If everything is set-up correctly, after browsing a few websites you will notice and increase in speed. By default, polipo stores its content to /var/cache/polipo, although that can be changed from the configuration file in /etc/polipo/config.

Using the Filesystem Cache

The package by default uses only memory cache however, it is possible to use both the filesystem cache and the memory cache (or just the filesystem cache) if you so desire. The memory cache is configured by the directives:

chunkHighMark = 1073741824
objectHighMark = 50331648

in /etc/polipo/config. You can lower these if you want and enable the filesystem cache by uncommenting and setting path for the disk cache. First, make a directory to store the cache:

mkdir -p /var/cache/polipo

and then uncomment and set the diskCacheRoot directive in /etc/polipo/config:

diskCacheRoot = "/var/cache/polipo"

The final step is to restart polipo to pick-up the changes.

Blocking Advertisements

polipo has a very efficient ad-blocking mechanism built-in. In order to make polipo block ads as well as cache resources, you need to place a file called forbidden in the /etc/polipo/ directory on your device. A sample forbidden file can be found on the spam database page. Download the domains.txt file, rename it to forbidden and place it in /etc/polipo. After that, restart polipo using Settings.app and polipo will block ads for you.

Bundled Configuration

The configuration file at /etc/polipo/config can be further tweaked and, additionally, allow you to use an upstream SOCKS proxy for polipo (for example, to combine with Tor.

The supplied configuration file is posted here for reference:

proxyAddress = "127.0.0.1"
proxyPort = 8123
allowedClients = "127.0.0.1"
## Uncomment for Tor
# socksParentProxy = "localhost:9050"
# socksProxyType = socks4a
## Memory Cache
chunkHighMark = 50331648
objectHighMark = 16384
## Disk Cache
diskCacheRoot = ""
## Statistics
localDocumentRoot = ""
disableIndexing = true
disableServersList = true
## IPv6
dnsQueryIPv6 = no
# dnsQueryIPv6 = reluctantly
dnsUseGethostbyname = yes
## Privacy
disableVia = true
censoredHeaders = from, accept-language
#censorReferer = maybe
File config not changed so no update needed
efa:~/org.grimore.polipo/etc/polipo root# cat config 
proxyAddress = "127.0.0.1"
proxyPort = 8123
allowedClients = "127.0.0.1"
## Uncomment for Tor
# socksParentProxy = "localhost:9050"
# socksProxyType = socks4a
## Memory Cache
chunkHighMark = 50331648
objectHighMark = 16384
## Disk Cache
diskCacheRoot = ""
## Statistics
localDocumentRoot = ""
disableIndexing = true
disableServersList = true
## IPv6
dnsQueryIPv6 = no
# dnsQueryIPv6 = reluctantly
dnsUseGethostbyname = yes
## Privacy
disableVia = true
censoredHeaders = from, accept-language
#censorReferer = maybe
#cacheIsShared = false
#relaxTransparency = maybe
## PMM
# pmmFirstSize = 16384
# pmmSize = 8192

The contents of the proxy.pac file is the following:

function FindProxyForURL(url, host) {
  if(shExpMatch(url, "https://*")) {
    return "DIRECT";
  }
  return "PROXY 127.0.0.1:8123";
}

and can be used along other tweaks to redirect your traffic to polipo.

Proxy-Chaining to Tor

Using both the Tor package and the Polipo package, you can build yourself a proxy chain that will both cache, filter ads and hide your IP address at the same time.

You will want to point your iOS device (or the ShadowSocks tweak from BigBoss) to polipo. Then you will point polipo to Tor.

This set-up can all be achieved easily, just by modifying some configuration files on your iOS device and we will go through each of them here.

Proxy Auto-Configuration File

The file /etc/polipo/proxy.pac that you can find on this page should be change to send both HTTPs AND HTTP traffic to polipo. Simply edit /etc/polipo/proxy.pac and make it look as follows:

function FindProxyForURL(url, host) {
  return "PROXY 127.0.0.1:8123";
}

Now, depending on whether you use ShadowSocks, ProxyManager or just supply your proxy directly you will have to point your iOS proxy to the /etc/polipo/proxy.pac file.

Chaining Polipo to Tor

We are now going to enable two directives in /etc/polipo/config on your device such that all the traffic will be sent through Tor:

socksParentProxy = "localhost:9050"
socksProxyType = socks4a

You are now set.


ios/polipo.txt ยท Last modified: 2022/04/19 08:28 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.