I was recently using a public wifi connection in a situation where I trusted neither the network operators nor the other wifi users around me. In order to protect my privacy and the security of my data passed over HTTP, I set up a web proxy using a temporary
Amazon EC2 instance. With an
ssh tunnel from my laptop to
squid running on the the EC2 instance, my HTTP traffic was encrypted over the wifi and local network, then went out as normal from Amazon's networks to the target web servers.
I started by firing up an instance of
ec2gutsy.notlong.com, a base Ubuntu 7.14 Gutsy server install which I previously built, registered, and made public. Feel free to use it yourself, though this basic approach would work with pretty much any AMI as long as you can install squid. You'll obviously need to have previously set up an Amazon AWS/EC2 account and have configured and installed some sort of client (command line, web, extension) to start up instances.
ec2-run-instances -k KEYPAIR ami-b111f4d8
ec2-describe-instances INSTANCEID
Install the squid proxy server (default config works just fine) and set up an ssh tunnel from port 3128 on the local computer to the squid port on the EC2 instance.
ssh -i SSHIDENTITY root@HOSTNAME "apt-get -y install squid"
ssh -i SSHIDENTITY -f -N -L3128:localhost:3128 root@HOSTNAME
Now all that's left is to configure the web browser to use the ssh tunnel to the squid proxy. In Firefox this is under: Edit / Preferences / Advanced / Network / Settings... / [X] Manual proxy configuration
Set the HTTP Proxy to "localhost" port "3128".
You can confirm that the network traffic is going through the Amazon EC2 instance by watching the squid log file on that instance while you browse:
tail -f /var/log/squid/access.log
I thought that paying 10 cents an hour (EC2 fee) to protect my privacy and security was a pretty good bargain, but don't forget to terminate the instance when you're done with it and reset your browser proxy settings.
[Edited 2008-03-14 to update AMI ID]