2

I have problem with same origin policy in my webapp. Here the situation: I have on my server 2 vitual machine one on 80 ( apache ) and one on 880 (tomcat) so in my webapp I have an iframe in this domain:

http://mydomain.com:8443

ouut of iframe I have the site in this domain

http://mydomain.com:443 (https standard)

so, if i try to comunicate with iframe javascript have a Same Orgin policy problem.

for example:

document.parent.myfunction();

return same origin problem. There is same way to bypass this policy? add some header inside the Iframe and inside my main app?? thanks a lot

r1si
  • 1,136
  • 2
  • 19
  • 34
  • possible duplicate of [Ways to circumvent the same-origin policy](http://stackoverflow.com/questions/3076414/ways-to-circumvent-the-same-origin-policy) – christopher Jan 18 '14 at 12:01
  • If you already have an apache running, why don't you use that as a reverse proxy to your tomcat? Then your javascript will always call back to the same server and port. If you don't want to do that, have a look at the [CORS header](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing). – Ralf Jan 18 '14 at 12:04
  • i recommend you EasyXdm http://easyxdm.net/wp/2010/03/17/sending-and-receiving-messages/ – john Smith Jan 18 '14 at 12:30
  • Possible duplicate of [Javascript and same origin iframes](http://stackoverflow.com/questions/2689984/javascript-and-same-origin-iframes) – Farid Nouri Neshat Dec 18 '16 at 15:05

0 Answers0