恼人的错误 #2048:来自本地主机的安全沙箱违规 [英] Annoying Error #2048: Security sandbox violation from localhost

查看:30
本文介绍了恼人的错误 #2048:来自本地主机的安全沙箱违规的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我放在 Web.config 的同一个文件夹中的 crossdomain.xml:

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>

虽然我可以使用 Security.loadPolicyFile("http://localhost:52090/crossdomain.xml") 加载.

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

当我的 swf 尝试与我的本地站点 (asp.net mvc) 通信时,它说:

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

错误 #2048:安全沙箱违规:http://localhost:52090/Content/Swf/MyApp.swf 无法从 localhost:52090 加载数据

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

我该如何解决?

推荐答案

由于您使用的是基于 Socket 而不是 URLLoaderas3httpclientlib你应该设置套接字策略服务器而不是 http 一个(所以你的 crossdomain.xml 在这种情况下不被 flash 使用).

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).

要设置 Flash 策略服务器,您可以使用本文中的 perl 脚本http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html 带有@Bart Friederichs 建议的策略 xml(带有 to-ports 属性)

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)

这篇关于恼人的错误 #2048:来自本地主机的安全沙箱违规的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆