Why is Flash demanding a crossdomain.xml file when the .swf and http target are both on localhost?

后端 未结 2 858
耶瑟儿~
耶瑟儿~ 2021-02-20 11:02

I\'ve got a small client/server test application where I have a Flex app that makes an HTTP request of a server app. The server app is a script running on my local machine, lis

2条回答
  •  余生分开走
    2021-02-20 11:27

    It may be that although you have the same host and protocol between the client page and server, the different port causes Flash to fail the same-origin test and request the crossdomain.xml to see what it's allowed to do. I'm assuming the page hosting your Flash content is running on port 80? If that's the case, check out Wikipedia's article on the same origin policy (http://en.wikipedia.org/wiki/Same_origin_policy) for the details.

    The crossdomain.xml doesn't seem to be too cumbersome for local testing and is pretty well documented on help.adobe.com. You can create a crossdomain.xml in the root of your website like this, which will allow all access:

     
     
     
         
         
    
    

    I wouldn't use the above for anything other than local development as you're basically allowing any domain to request content.

    Hope this helps!

提交回复
热议问题