0
votes

I'm trying to open a socket to my server, but it doesn't work, I'm always getting the famous

Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: http://zappy.mydomain.fr/ZappyGraphic.swf cannot load data from zappy.mydomain.fr:4242.

I have a crossdomain.xml at the root of my domain, looking like that:

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

And in my actionscript program, here is how I load the crossdomain policies

Security.allowDomain("*");
Security.allowInsecureDomain("*");
Security.loadPolicyFile("http://mydomain.fr/crossdomain.xml");

The server is located at mydomain.fr on the port 4242 and the swf file is located at http://zappy.mydomain.fr/index.html...

Can someone enlighten me?

1
Check out this my answer stackoverflow.com/questions/17364372/…, http crossdomain policy file doesn't used by socket, you have to setup policy socket server - fsbmain
@fsbmain What's the difference with my file, excepting the allow-http-request-headers-from? - Julien Fouilhé
the difference is that you use Socket, rather than URLLoader, is that true? if so, socket don't use http for loading policy file, it uses socket policy server, that required some additional setup. - fsbmain

1 Answers

1
votes

It seems like you can not have a space at the end of the line, so:

<allow-access-from domain="*" secure="false" />

Has to be

<allow-acces-from domain="*" secure="false"/>

Thanks to make me lose my time ! :D

And, as @Gio made me notice, you have to configure a socket policy server listening on port 843. Here is my nginx configuration if someone needs it:

server {
    listen 843;
    server_name mydomain.fr;
    location / {
        rewrite ^(.*)$ /crossdomain.xml;
    }

    error_page 400 /crossdomain.xml;

    location = /crossdomain.xml {
        root /usr/share/nginx/www/root;
    }
}