Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
765 views
in Technique[技术] by (71.8m points)

asp.net mvc - Annoying Error #2048: Security sandbox violation from localhost

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...