Thursday, November 13, 2008

Watching BBC online overseas

I need to watch the All Black playing Ireland on Sunday but here in Spain I have no idea where to watch the game with English commentary. BBC makes a lot of video content available on their website but only if you are in the UK.

I have servers running in the UK and knew it must be possible to somehow use them as a proxy so that the British Broadcasting Commissioners think that I too am in old Blighty. But how to hook it all up?

After a bit of Googling on the interweb I discovered that OpenSSH can be used as a SOCKS proxy which creates a secure connection to any server you can ssh into and then fires off your requests from there. OpenSSH is the flavour of SSH that runs on Mac OS X so all I had to do was type this at the terminal to start the proxy:

ssh -ND 9999 myserver.co.uk

The -N just tells ssh that I don't want to send any commands - just set up the proxy and listen on local port 9999.

Then you need to tell your browser to use the SOCKS proxy. Safari proxy settings are just the system wide network preferences. Just click on advanced and then Proxies and add a SOCKS proxy at localhost port 9999 and voila!. But I don't want all my browsing to use the proxy - most sites should connect directly.

So I installed the handy little FireFox plugin, FoxyProxy, which can selectively send some requests through the proxy and not others. It looks pretty flexible but I simply set it to use my proxy for all URL's and then used Safari as normal for direct browsing.

Now I can watch Top Gear on BBC too! And also, when I look at my website which has advertising including Google AdSense and Yahoo PPC ads I can see the same ads that users of my site in the UK see!

Nice.

No comments: