A week ago, I received my Raspberry PI through the mail. Due to real life issues, I wasn’t able to do testing on this small ARM computer.
So after buying a cheap usb wifi dongle and assembling the casing, I decided to try a real life probable use of the PI.
On slow networks, traffic optimization is a necessity. It may not be as useable in our advent of fast broadband connections, but it is good to know how to do this.
For connecting to web sites with slow connections, we use a program named ziproxy.
Ziproxy is a Forwarding, non-caching, HTTP proxy targeted for traffic optimization. This open source application works by compressing pictures and other data.
Aside from traffic optimization I wanted to add caching to the mix (to deliver already visited sites without refetching the data from the actual site). Since ziproxy is a non-caching HTTP proxy, I decided to add the ever-popular Squid caching proxy to the mix.
This is the simplest way to do it (take note that I didn’t take into account on how to secure the Squid and ziproxy settings, as my Raspberry PI was behind a tomato flashed router so it wasn’t really accessible from the outside).
Let us install ziproxy and squid:
# sudo apt-get install ziproxy squid
open up ziproxy.conf:
# sudo nano /etc/ziproxy.conf
Uncomment the lines below and change it as follows:
3128 is the default port of the Squid proxy server. Let us leave the default values as is.
We need to restart the ziproxy daemon:
# sudo service ziproxy restart
We are now ready to test this out, depending on the the assigned IP address of your raspberry pi, change the settings of your browser to point to your raspberry pi (the settings below is from a firefox screenshot):
We can see that the proxy on your raspberry pi is working as expected (I used a link to my blog as a test bed):
This is a screenshot without passing through the proxy:
And this is the screenshot while passing through the proxy: