Here is my situation:
I have a Webserver machine, Client machine, and a third machine running some program that listens for XMLHttpRequests.
Client accesses the Webserver from the Client machine, makes some changes, and then clicks on'Save'. At this point, data is being sent back to the Webserver and to the Third machine. All of this is being done using Javascript and XMLHttpRequest object.
The post to the Webserver works fine, however post to the Third machine does not work, since it had a different IP/domain.
How can I make this work? Client machine -> Third machine does not work, because its on a different domain Webserver machine -> Third machine does not work, because of firewall issues
Any ideas are greatly appreciated!
What you're running into is the Same origin policy, not firewall issues.
If the machines share a top-level domain, you can set their document.domain properties to match:
Two sites sharing a common top-level domain may opt to communicate despite failing the "same host" check by mutually setting their respective document.domain DOM property to the same qualified, right-hand fragment of their current host name.
Otherwise, you may need to setup your first host to proxy the request to the other host.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With