A web server runs on my local network. Let's say on: http://192.168.1.12
When I visit this url with a browser, it's working fine.
When I visit this url with curl (zsh), it's working too:
curl -s "http://192.168.1.12/"
But when I try with javascript with XMLHttpRequest:
var x = new XMLHttpRequest();
x.open("GET", "http://192.168.1.12/", true);
x.send(null);
it fails (error message translated): CORS header "Access-Control-Allow-Origin" is missing.
I cannot modify the server behavior, but I think I don't need to because it's working with curl. What should I add to my javascript code to make it work?