Annoying Error #2048: Security sandbox violation from localhost

孤者浪人 提交于 2019-12-18 09:02:13

问题


This is my crossdomain.xml that I put in the same folder of my Web.config:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
    <site-control permitted-cross-domain-policies="all"/>
    <allow-access-from domain="*" secure="false" />
    <allow-http-request-headers-from domain="*" headers="*" />
</cross-domain-policy>

Although I can load using Security.loadPolicyFile("http://localhost:52090/crossdomain.xml").

When my swf try to comunicate with my local site (asp.net mvc) it says:

Error #2048: Security sandbox violation: http:/ /localhost:52090/Content/Swf/MyApp.swf cannot load data from localhost:52090

How do I solve that?


回答1:


Since you use as3httpclientlib that based on Socket, rather than URLLoader you should setup socket policy server instead of http one (so your crossdomain.xml isn't used by flash in this case).

To setup flash policy server you can use perl script from this article http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html with policy xml suggested by @Bart Friederichs (with to-ports attribute)




回答2:


Try this one:

<?xml version="1.0"?>
<cross-domain-policy>
  <site-control permitted-cross-domain-policies="all"/>
  <allow-access-from domain="*" to-ports="*" />
</cross-domain-policy>

also, if you send it yourself, make sure to send a null-character in the end.



来源:https://stackoverflow.com/questions/17364372/annoying-error-2048-security-sandbox-violation-from-localhost

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!