We've covered several ways to access blocked stuff on the web, but most free proxies are problematic; namely, they go down, and they're slow. Lifehacker AU explains how to set up a Squid proxy on your own server to avoid those problems.

The web is a generally free place, but some sites and services want to make it annoying to navigate …
Read more Read more

Note: This tutorial is fairly technical, and requires that you're willing to pay for server space of your own in the U.S. If you're based in the U.S. and looking to access geo-locked content in other countries, you'd want to rent your server space in the appropriate place. For another great alternative that you control, check out Digital Inspiration's guide to using Google App Engine as a free proxy server.

One of the perennial challenges for Australian TV enthusiasts is finding a way to use Hulu and other geo-blocked streaming services. Here's how Lifehacker reader Luke Carbis solved the problem.

I realise that you've featured Pandora and Hulu access from overseas on your site before, but this way hasn't really been done before. The beauty of it is that once you've got it set up, you don't have to look at it or think about it ever again!

The premise

We're going to set up the U.S. server to run a proxy (alongside Apache, because my server is a web server, too). Then we're going to tell our computer to use that proxy for the web, but only if the URL is pandora.com or hulu.com.

Step 1: Install Squid

Squid is a fully-featured HTTP/1.0 proxy. Log into your server via SSH, and install it by using this command:

sudo aptitude install squid squid-common

Step 2: Edit the Squid config file

You can edit the file using vi or nano while you're in the SSH environment like this:

sudo vi /etc/squid/squid.conf

Or you can just use FTP. The file you want is located at /etc/squid/squid.conf.

Now there's two things that we need Squid to do, which we specify using this file.

1. Authenticate the user by checking their IP, and

2. Use port 8080 so we don't have any Apache conflicts

You can download my squid.conf file here. Change lines 603-606 to allow your own IP addresses (instead of the two IP addresses I use).

Step 3: Restart Squid

First, correct your permissions with:

sudo chown -R proxy:proxy /var/log/squid/

sudo chown proxy:proxy /etc/squid/squid.conf

And then restart with:

sudo /etc/init.d/squid restart

Step 4: Set up your proxy settings

Sounds easier than it actually is. It's not as simple as using http://your-server.com:8080, because we only want to use that as a proxy if the URL is something specific (pandora.com). Instead we need to create a custom .pac file with our specific proxy settings.

So, create a .pac file (it's just plain text), and save it with the following:

function FindProxyForURL(url, host)

{

// variable strings to return

var proxy_yes = "PROXY your-server.com:8080″;

var proxy_no = "DIRECT";

if (shExpMatch(url, "http://www.pandora.com*")) { return proxy_yes; }

if (shExpMatch(url, "*pandora.com*")) { return proxy_yes; }

if (shExpMatch(url, "http://www.hulu.com*")) { return proxy_yes; }

if (shExpMatch(url, "*hulu.com*")) { return proxy_yes; }

// Proxy anything else

return proxy_no;

}

You can save this to your hard drive for use, or you can upload it to your server and link to it that way. If you have multiple machines using this file, I would recommend the latter so you can easily update the proxy settings for all of them if you need to.

On a Mac, you can tell your computer to use this file for it's proxy settings by opening System Preferences, clicking Advanced, clicking on the proxies tab, choosing Automatic Proxy Configuration, and entering the URL there (or choosing a file on your hard drive). I'm sure you can do it on Windows too, but I'm not sure how (you'll figure it out, I'm sure).

Once those settings are saved you should be good to go. Enjoy Pandora and Hulu from Australia without having to open a special program or change your network settings!