DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: IDEA: a tiny local URL rewrite engine to help the Chinese watch youtube  (Read 5,393 times)

electronixtar

  • Member
  • Joined in 2007
  • **
  • Posts: 141
Hi DC,

Youtube is blocked in China, but there's a walkaround, set browser's Auto Proxy Config like this:

Code
if (shExpMatch(host, "*.youtube.com"))
{
    return "PROXY www.google.cn:80;";
}

You can view the youtube pages, but no videos. because the border firewall will RST every TCP port 80 request which contains the string ".googlevideo.com" (If you visit mit.edu/?.googlevideo.com, mit.edu will get blocked for couple of minutes), and it will spoof every DNS request of *.googlevideo.com to some non-exist IP address.

Now if there's a local URL rewrite change could change
Code
http://v3.lscache7.googlevideo.com/videoplayback?xxxxxx
to
Code
http://74.125.170.150/videoplayback?xxxxxx

it will work.

SO what I need is a tiny, local URL rewrite proxy engine that could do the job above, and using PAC like following

Code
if (shExpMatch(host, "*.youtube.com"))
{
    return "PROXY www.google.cn:80;";
}
if (shExpMatch(host, "*.googlevideo.com"))
{
    return "PROXY localhost:3333;";
}

Everyone can view youtube.

There's another usage, for every Google.com search result, the cached function won't work, but if you change the URL
Code
http://74.125.155.132/search?q=cache:ucajK2mTlHwJ:www.xxx.com
to
Code
http://74.125.155.132/search?by=DonationCoder&q=cache:ucajK2mTlHwJ:www.xxx.com

The page will load, because GFW only blocks URL contains the keyword "search?q=cache:"

I hope the program is compiled standalone, has a tray icon, scans a regex config file (live update running config everytime the file changes), then 302 redirect match HTTP request.
« Last Edit: July 14, 2009, 11:52 AM by electronixtar »

Original address: https://www.donationcoder.com/forum/index.php?topic=19165.0