Browser Ajax crossdomain issue - Python twisted reverse proxy to rescue.11 Jul 2012 Tags:
It is big day today. It’s first time python came in handy in my day-to-day job ;) Ok, ok, there might have been 5ek other ways to nail that, but it felt so good then need for ‘learn-some-stuff-in-your-spare-time’ emerged.
The colleague of mine is developing html5-mobile application. He wanted to test/troubleshoot it on his Mac while developing (w/o need to perform the whole
build->package->deploy to mobile/emulator cycle). So, he started with some simple html page and certain amount of jQuery ajax. The problem occurred immediately: Ajax crossdomain issue.
- browser: Safari
- html url:
- service url:
As always, google + stackoverflow pointed out the simplest solution.
As we all (or some) know, Mac already comes with python and ruby. So, I decided the simplest way to go would be some sort of python or ruby reverse-proxy script (other straightforward solution would be apache + mod_proxy).
Vuala, problem solved. Python you rock!
NB. If you've found typos or errors, please suggest a correction or edit on github.