Listening to Foreign Radio Station Tunein Radio(iOS) in China
I am always a big fan of radio stations. "When I was young, I listen to the radio..." is one of my favorite quote of English songs. Anyway, I have been a fidele user of TuneIn radio app for iOS(https://itunes.apple.com/us/app/tunein-radio/id418987775?mt=8) for many years. But since some days ago, it seems they disabled the abilities for Chinese mainland users to listen to ANY foreign radio stations. May be they recieved the pressure from Chinese government. But as a innocent user, I give the dev team a 0 star review for this issue.
Anyway, as we are able to jailbreak our iOS device and there has been a very great proxy software, goagent(http://code.google.com/p/goagent/wiki/GoAgent_IOS). There is then a way to combine the two to enable TuneIn radio work again.
However when you try to use the proxy directly, the browse function works but when you try one of radio station, the buffering process will never complete, I guess the way goagent handling do not streaming URLs very well.
Luckily we have pac files to decide proxy setting for individual URL request. I set up a proxy server on my MAC with command windows showing the URL requested, and set the proxy server of my iPad to PC, and get to know there are two main URLs that TuneIn uses:
http://opml.radiotime.com/Tune.ashx?formats=mp3%2Caac%2Cwma%2Creal%2Cogg%2Cflash%2Cwmpro%2Chls&render=xml&listenId=38547666952&id=s16221&serial=2f20c6a770bf2288028dae28daf11c67&version=3.4&partnerId=k2YHnXyS
http://opml.radiotime.com/Browse.ashx?formats=mp3%2Caac%2Cwma%2Creal%2Cogg%2Cflash%2Cwmpro%2Chls&render=xml&id=s16221&serial=2f20c6a770bf2288028dae28daf11c67&detail=recommendation%2Cgenre%2Caffiliate%2Cpodcast&version=3.4&partnerId=k2YHnXyS
When you try to access them from China IP address, you will get incorrect result. (again thumb down for the team behind TuneIn). So we just need to add the following line to the begining of your PAC file. It will just direct the above required URL to use proxy server.
var PROXY = "PROXY 127.0.0.1:8087";
if (host == "feed.tunein.com"){
return PROXY;
}
if (host == "opml.radiotime.com"){
return PROXY;
}
Note: If you are using a PAC that is encoded with base64, you need to decode it first, may be with a short Python script like this:
import os,sys
myfile=open('./result.pac','w')
import base64
s = "CONTENT IN YOUR CURRENT PROXY FILE CONTENT"
res = base64.b64decode(s)
myfile.write(res)
Now you can upload the new PAC to your iPad with iFile, and it will work like a charm, you are advised to test your PAC file againt the two URL above, as testing this on iPad can be troublesome.
Note: probably 90% of the problem is caused by malformat in your PAC file, pay attention!
Good luck!
Lastly I'd like to express my strongest Despise to the people who worked on the GFW project.
Anyway, as we are able to jailbreak our iOS device and there has been a very great proxy software, goagent(http://code.google.com/p/goagent/wiki/GoAgent_IOS). There is then a way to combine the two to enable TuneIn radio work again.
However when you try to use the proxy directly, the browse function works but when you try one of radio station, the buffering process will never complete, I guess the way goagent handling do not streaming URLs very well.
Luckily we have pac files to decide proxy setting for individual URL request. I set up a proxy server on my MAC with command windows showing the URL requested, and set the proxy server of my iPad to PC, and get to know there are two main URLs that TuneIn uses:
http://opml.radiotime.com/Tune.ashx?formats=mp3%2Caac%2Cwma%2Creal%2Cogg%2Cflash%2Cwmpro%2Chls&render=xml&listenId=38547666952&id=s16221&serial=2f20c6a770bf2288028dae28daf11c67&version=3.4&partnerId=k2YHnXyS
http://opml.radiotime.com/Browse.ashx?formats=mp3%2Caac%2Cwma%2Creal%2Cogg%2Cflash%2Cwmpro%2Chls&render=xml&id=s16221&serial=2f20c6a770bf2288028dae28daf11c67&detail=recommendation%2Cgenre%2Caffiliate%2Cpodcast&version=3.4&partnerId=k2YHnXyS
When you try to access them from China IP address, you will get incorrect result. (again thumb down for the team behind TuneIn). So we just need to add the following line to the begining of your PAC file. It will just direct the above required URL to use proxy server.
var PROXY = "PROXY 127.0.0.1:8087";
if (host == "feed.tunein.com"){
return PROXY;
}
if (host == "opml.radiotime.com"){
return PROXY;
}
Note: If you are using a PAC that is encoded with base64, you need to decode it first, may be with a short Python script like this:
import os,sys
myfile=open('./result.pac','w')
import base64
s = "CONTENT IN YOUR CURRENT PROXY FILE CONTENT"
res = base64.b64decode(s)
myfile.write(res)
Now you can upload the new PAC to your iPad with iFile, and it will work like a charm, you are advised to test your PAC file againt the two URL above, as testing this on iPad can be troublesome.
Note: probably 90% of the problem is caused by malformat in your PAC file, pay attention!
Good luck!
Lastly I'd like to express my strongest Despise to the people who worked on the GFW project.
Nice
ReplyDelete