views:

1036

answers:

3

Hello,
I am running a HTTP server on my development machine. I have a website, on some web server on the Internet. How can I get Firefox to allow communication from this website to localhost temporarily while I develop?
Thanks,
Isaac Waller

+1  A: 

You could use a local proxy (such as fiddler) to route the AJAX requests to the service on your LocalHost.

Zhaph - Ben Duguid
You can trivially write some FiddlerScript to do this. See http://www.fiddler2.com/fiddler/dev/scriptsamples.asp for the "Retarget requests" sample.
EricLaw -MSFT-
+4  A: 

The approach I use in this situation is to insert a hosts-file entry mapping localhost to a subdomain of the target internet site.

DDaviesBrackett
I tried this but you are not allowed to AJAX to a subdomain (?)
Isaac Waller
by editing document.domain (see https://developer.mozilla.org/en/DOM/document.domain), you can relax the single-origin policy.
DDaviesBrackett
A: 

If you really need to do it you can set up your web server so it temporarily serves the content with an access-control header. But for your situation it would be best to use a proxy. See this:

http://ajaxian.com/archives/cross-site-xmlhttprequest-in-firefox-3

Vasil