Archive for July, 2010

Faster mobile browsing through a compressing proxy server

Sunday, July 25th, 2010

Introduction
A few days ago I tested the Opera web browser on my Android smartphone. The first thing I noticed: It is amazingly fast! This is because all web traffic is routed through an Opera Turbo server, which will compress the complete website and forward it to your smartphone afterwards. You will notice the reduced quality of the images, however it’s worth the increased speed. No doubt this is a great feature. On the other side, Opera had trouble rendering some websites and the (multi-)touch interface is not that great either.

Therefore I wondered if there is any possibility to make use of a similar feature using the standard Android browser. After searching the web for a while, I stumbled upon Ziproxy, which “is a forwarding (non-caching) compressing HTTP proxy server”. It allows you to surf the web blazingly fast while reducing the traffic at the same time. It does so by compressing HTML files and images. This sounded great, so I gave it a try. Please find an install guide below. The first thing I noticed on my desktop computer were the artifacts caused by the reduced image quality. However you will not really see them on your smartphone. In order to use it on an Android smartphone you have to do nothing but to set up a proxy server. (Which is described below)

There are many websites that already compress their hypertexts. Hence the reduced image quality will have the greatest effect on the network traffic. I’ve not had the time to thoroughly test it, yet. I will do so in the next couple of days. Especially in areas with bad network coverage.

Note that Ziproxy is not capable of HTTP persistence. This means a new connection for every element(like images) on a website. This could negatively influence the performance. Consequently I’m assuming that the Opera Turbo is outperforming Ziproxy regarding the rendering speed. Though this does not affect the traffic reduction.

How to install Ziproxy on an Ubuntu server
The first thing you need is a Unix server. There are packages available on the project’s website for many Unix/Linux distributions. If you have an ubuntu version below lucid you have to compile the software yourself. This is how to do so:

Download the tarball from the website, and extract it:
tar xvjf ziproxy-3.1.3.tar.bz2

You have to install some packages in order to be able to compile ziproxy:
apt-get libungif4-dev libungif-bin libpng12-dev libpng12-0 libjasper1 libjasper-dev libjpeg62 libjpeg62-dev zlib1g build-essential

Now you may issue the standard make commands:
./configure
make
make install

If everything went well you will find the binary in /usr/local/bin/, you may want to check that.

Copy the config file to an appropriate location:
cp -R etc/ziproxy/ /usr/local/etc/

Create a new user:
adduser ziproxy --no-create-home --disabled-login

Now edit the config file, (/usr/local/etc/ziproxy/ziproxy.conf):

  • RunAsUser = “ziproxy”
  • RunAsGroup = “ziproxy”
  • You may want to change the default port.

I recommend to set up some authentication, otherwise your proxy might be abused by someone:
Uncomment the line referring to a “PasswdFile”. This file should contain a username and a plain text password separated by a colon.

Test it:
ziproxy -d -c /usr/local/etc/ziproxy/ziproxy.conf
Your proxy is now running. You have to configure your client to use it. This depends on which browser you are using. Below you will find a description on how to configure your Android smartphone.

Autostart:
Copy the statup script to /etc/init.d:
cp etc/init.d/zipproxy /etc/init.d/

Edit the paths inside this file according to your configuration.

Now add it to some runlevels, e.g. 1 through 5, using a tool like sysv-rc-conf.

How to configure a proxy on an Android smartphone

  1. Install and launch Any Cut
  2. Create a new shortcut -> Activity -> Proxy Settings
  3. Launch the created shortcut.(You’ll find it on some of your home screens)
  4. Enter your server’s domain and the port you specified in the config file
  5. ???
  6. Profit