I first discovered Pandora as a houseguest of Mike Arrington’s back in early 2006, and was immediately hooked. Unfortunately a year or so later, back in Australia, Pandora started blocking access since I wasn’t coming from a US IP address – all over about music licencing territories and a dispute over internet radio royalties that played out until late 2008 in the US alone. While I can’t blame them for picking their battles and deciding the rest of the world could wait until they’d saved their business, I was pretty disappointed as an avid user and fan.
After reading Mike’s latest “Products I can’t live without” post, I thought I’d put 20 mins of work into getting access to Pandora back again. Getting first time access to Hulu and other sites that block international users is on the agenda too, but I’ve got Pandora back now, and I couldn’t be happier. Here’s how I did it.
- Firefox web browser
- FoxyProxy plugin
- Someone else’s Proxy Server or an Apache Web Server on which you can configure mod_proxy
- I’ll assume you’ve got Firefox. If not, step 3 is probably going to seem a bit tough.
- Install FoxyProxy. You might see a warning about the plugin being unsigned. This is common for open-source plugins, and since Mozilla recommend this one, I reckon you’re fairly safe, so choose OK.
- When FoxyProxy first loads (following a restart) it will probably ask you whether you want to configure it to use TOR (The Onion Router). If you don’t know what that is, choose no.
- From the FoxyProxy options (which will be open by default on first run, but which can be re-opened by clicking on the “FoxyProxy” link in your status bar (the bit at the bottom of your browser), you need to configure a your rules so that attempts to go to Pandora go through your (or someone else’s) US based Proxy Server, as described below in “Configuring FoxyProxy”.
What is a Proxy
In the sense we use it here, a proxy is a computer that makes requests for web pages, images and other we content on your behalf to another server. So, you make a request of the proxy, and the proxy then makes the request to the destination server on your behalf, and when it gets a response from the destination server – in this case, Pandora.com – it receives it and then passes it back into your browser.
In default mode, Firefox (like most web browsers) can only run with one proxy server configured at a time; this is problematic because while I want to use my Proxy to access Pandora, I don’t want all my traffic crossing the Pacific (twice): it would slow things down a lot when I’m browsing Australian websites.
This is why you need FoxyProxy: it allows you to apply logic and rules to what traffic you send via the proxy, and which you let go through normally (usually directly). You can even define different multiple proxies, each of them having their own rules or patterns that bring them into play.
Before configuring FoxyProxy, you’ll need to have a proxy server to use. Here, you’ve got two options: you can try using a public open proxy, or if you’ve got a web hosting account that gives you access to Apache’s configuration files, you can make one yourself.
Using a Public Proxy Server
Using a Public Proxy Server is pretty easy, although there’s no promises as to the reliability of the servers you want to connect through: remember, Pandora is streaming radio, which means if the Proxy your using is being used by a lot of other people, you might not have enough bandwidth to suck the music stream down through.
I did a quick Google search, and the xroxy.com list ranked pretty well. I can’t vouch for it or any of the Proxies it lists, but it looked OK. If you don’t have access to your own Apache server in the US, this is what you’ll need to use.
Making Apache a Proxy Server
If you’ve got access to an Apache server, you can make your own Proxy in a few quick minutes. I’ll take you through the steps now.
- Open httpd.conf, or a file that httpd.conf includes, often found in /etc/httpd/conf/httpd.conf or somewhere similar, in your favourite editor.
- Scroll down the file, and look for a LoadModule directives that mention “proxy”. There are two we need to make this work: mod_proxy and mod_proxy_http. If they’re there, then you’ve got the prerequisites you need.
- NB: If the line that mentioned them has a # at the start of this, that means they’re currently disabled: remove the # at the start of the line to enable them the proxy functionality in Apache.
- If you can’t find these directives, it might be that your hosting company doesn’t let you edit your core httpd configuration file. This isn’t uncommon, particularly in shared environments. If you’ve got the ability to edit at least some configuration files, you might get lucky and find that mod_proxy is enabled already, so keep perservering cross your fingers.
- Now we’ve established that you have proxy (or we’re hoping you do), its time to configure the proxy. My configuration (with the IP address for Allow from changed) is below:
ProxyRequests On ProxyVia Off <Proxy http://*.pandora.com/*> Order deny,allow Deny from all Allow from aaa.bbb.ccc.ddd </Proxy>
- The block of code allows people from the IP address listed in the Allow from line to access http://www.pandora.com, streaming.pandora.com or any other prefix of pandora.com, as well as allowing those people to access files and subdirectories of *.pandora.com. MAKE SURE YOU PUT YOUR OWN IP ADDRESS IN THE ALLOW FROM DIRECTIVE. You can find your IP address from the aptly named WhatIsMyIP.com site.
- When you’re done, do an apachectl configtest and if Apache is happy, do an apachectl graceful to reload the configuration files.
Once this is done, it’s time to configure FoxyProxy so that your browser actually makes requests to your new proxy when you’re trying to go to Pandora.
Configuring FoxyProxy wasn’t too hard, but if you’re not familar with the terminology, its easy to feel confused. Here’s a step by step.
- Inside the FoxyProxy options box (you can get to it using the instructions described above), you want to click on “Add New Proxy” on the right hand side.
- On the next screen, under the “General” tab, give your Proxy a name. If you’re using a public proxy, use the name from the listing website; if you’re using your own, give it a name like “MyProxy”.
- From the “Proxy Details” tab, enter the address of the proxy. If you set up your own proxy, this will be your server’s hostname or IP address. You also need to choose a port: if you set up your own server using the Apache instructions above, it will likely be 80; if you used a public proxy, look for the number after the : in the address if they don’t specify an explicit port number. Also, if you created your own Proxy using Apache, leave the SOCKS box unticked.
- The “URL Patterns” tab is where you tell your browser to use this proxy whenever you’re going to Pandora.com.
- Click on “Add New Pattern”
- Type a name for the pattern that makes sense to you, eg, Pandora
- Type the following into the URL pattern box: http://*pandora*/*
- Leave the default radio buttons (whitelist and wildcard)
- Click on OK to save the Pattern, and then OK to save the FoxyProxy settings, and then close.
- Now, you need to enable FoxyProxy. Simply right-click on “FoxyProxy” text in the status bar, and choose “Use proxies based on their pre-defined patterns and priorities”.
- Try going to http://www.pandora.com – this is the real test of your Proxy server, and whether it will let you pass traffic through to Pandora. The following results might give you an idea of what where a problem lies:
- 403 Forbidden Error: the Proxy isn’t letting you get through to Pandora.
- If you’re using a pubic proxy, then they don’t like you, or don’t like Pandora. Either way, choose another proxy.
- If you’ve set up your own Proxy using Apache, you’re either coming through from a different IP address than you thought (check for typos on the “Allow from” line), or you’ve typed in your “<Proxy>” directive incorrectly; check there for typos too.
- If you get the “restricted” page from Pandora telling you your IP address is outside of the US, then one of the following has occured:
- If it shows you your IP address, then you either haven’t turned FoxyProxy on (make sure you do Step 5 above), or you’ve made a mistake when setting up your URL Pattern: go in and have another look.
- If it shows you another IP address, like that of your Proxy, then Pandora doesn’t think the Proxy is in the US. Use another Proxy.
- 403 Forbidden Error: the Proxy isn’t letting you get through to Pandora.
These are a few instructions that worked for me: they’re not going to work for everyone, and they don’t take into account the myriad of different ways you can set up Apache servers in particular.
Hope you’ve found them useful – if you’ve got questions, please post them in the comments and I’ll do my best to answer them.