How the same origin policy applies to IP addresses

I have a server on our intranet that runs JBoss. I want to send API calls to this server from my machine, also on the intranet, and get the received XML responses using jQuery.

I read the entry on Wikipedia , but I don’t understand how this relates to my situation, because our machines only have IP addresses, not domain names.

I have

  • Server URL : 10.2.200.3:8001/serviceroot/service
  • Client IP : 10.2.201.217

My questions:

  • As far as I understand, these are different areas, right? Therefore, I must use a proxy to call jQuery.ajax on the server
  • If I want to avoid execution (2), can I install Apache on the server and server page with the JS code form? But then JS will be from 10.2.200.3, and the server will be from 10.2.200.3:8001. Isn't that considered different domains according to policy?

Thank!

+5
source share
2 answers
  • Yes.

  • Yes, different ports have different origins. This is what most browsers have done in JS for a while, but it is explicitly described in the HTML5 draft referenced by the XMLHttpRequest project .

If A and B have port components that are not identical, return false.

+2
source

, . , , . - - - .

, , JSON-P.

+2

All Articles