Cross Domain XMLHttprequest

Here is my situation:

I have a Webserver machine, a client machine, and a third computer running a program that listens for XMLHttpRequests.

The client accesses the web server from the client computer, makes some changes, and then clicks "Save." At this point, the data is sent back to the web server and to the third machine. All this is done using Javascript and an XMLHttpRequest object.

The message on the web server works fine, but the mail on the third machine does not work because it has a different IP address.

How can I do this job? Client machine → The third machine does not work because it is in a different domain The web server machine → The third machine does not work due to problems with the firewall.

Any ideas are welcome!

+5
source share
4 answers

What do you work for, Same origin policy , not firewall issues.

If computers share a top-level domain, you can set your document.domain properties accordingly .

Two sites sharing a common level can choose a domain for communication, despite failing to verify the "same host" by mutually setting the corresponding document.domain DOM for the same qualified, right-hand fragment of their current host name.

- .

+3

CORS ( ) .

, Opera Explorer 10 .

, CORS .

+3

iframe hack. IFrame, , , , iframe .

+2

Another option (which is admittedly a bit technical) is to use YQL if the data is not sensitive. You can use YQL and JSON-P to get data from other domains.

+1
source

All Articles