Access Hulu And Other Blocked Services Using Squid

On 2010年10月9日, in tips, by netoearth

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!

  • A server in the US (I use Slicehost, but any US server will do)
  • SSH access to said server

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 or

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, because we only want to use that as a proxy if the URL is something specific ( 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″;
var proxy_no = “DIRECT”;
if (shExpMatch(url, “*”)) { return proxy_yes; }
if (shExpMatch(url, “**”)) { return proxy_yes; }
if (shExpMatch(url, “*”)) { return proxy_yes; }
if (shExpMatch(url, “**”)) { 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!

Thanks Luke!


Comments are closed.