Big Bubbles (no troubles)

What sucks, who sucks and you suck

Fixing Youtube via Proxy on iPhone

The problem: The Youtube app doesn’t work on the iPhone and iPod Touch when a proxy is configured in the wifi settings. There are various hints on the forums that a particular URL used by the app requires rewriting (as the request says one thing but the Host header says something else). However, no one AFAIK has provided actual code to fix this.

The solution: (Squid users only) the following script should be configured as a redirector in Squid (e.g. redirect_program /usr/local/bin/youtube_redirect):

#!/usr/bin/perl -w
$|=1;
while (<>) {
    s@http://iphone-wu.apple.com/feeds/api/@http://gdata.youtube.com/feeds/api/@;
    s@http://iphone-wu.apple.com/feeds/videos/@http://gdata.youtube.com/feeds/videos/@;
    print;
}

Also set url_rewrite_host_header off and reload your Squid config. This should fix the broken URLs generated by the Youtube app and still allow the proxy to work for all other requests.