5/26/2011 12:37:03 AM
Title:
Security Sandbox error
I have my application(flex project) running on server(java) at
http://172.22.7.7:8080/myApp/hello.html
we have one more audio server in same system but at different port
172.22.7.7:9999
i have to intialize the socket connection between two of them.
bu when i call for
socket.connect("172.22.7.7","9999");
it throws security sandbox error...
i have crossdomain.xml in all folders of audio server
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="172.22.7.7"/>
</cross-domain-policy>
still i get error...in debugger console
Trying to connect to localhost
Warning: [strict] Ignoring policy file at xmlsocket://172.22.7.7:9999 due to incorrect syntax. See http://www.adobe.com/go/strict_policy_files to fix this problem.
*** Security Sandbox Violation ***
Connection to 172.22.7.7:9999 halted - not permitted from http://localhost:8080/myApp/hello.swf
Error: Request for resource at xmlsocket://172.22.7.7:9999 by requestor from http://localhost:8080/myApp/hello.swf is denied due to lack of policy file permissions.
if any one knows solution for this.. please let me know
Inder
Points: 2980
Posts:0
5/26/2011 11:25:30 AM
try following crossdomain.xml file . For testing purpose always use * for domains that allows all the domains . Once the application works you can specify proper domain instead of *. This file should be kept at root of the domain and should be accessible like http://172.22.7.7:8080/crossdomain.xml
<?xml version="1.0" ?>
- <cross-domain-policy>
<site-control permitted-cross-domain-policies="master-only" />
<allow-access-from domain="*" />
<allow-http-request-headers-from domain="*" headers="*" />
</cross-domain-policy>
5/27/2011 12:41:25 AM
@inder
that audio server is like an application not a webserver.
so..
currently when i try to connect socket
using socket.connect(host,port);
at server they get <policy-file request />
then they send the above crossdomainpolicy.xml in text format.
after that i get a security sandbox error saying
"ignoring policy file due to syntax error".
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*" to-ports="*"/>
</cross-domain-policy>
5/28/2011 12:25:53 PM
this does not seems to be a problem with crossdomain file. Flash player will try to access the policy file from location "172.22.7.7:9999/crossdomain.xml". I don't think this will be accessible so its giving a syntax error.
5/30/2011 4:10:43 AM
SOLVED::
----------
string format of CrossDomainPolicy worked fro me is below...
"<?xml version=\"1.0\"?>\
<!DOCTYPE cross-domain-policy SYSTEM \"http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd\">\
<cross-domain-policy>\
<allow-access-from domain=\"*\"to-ports=\"4213\" secure=\"false\" />\
</cross-domain-policy>\0";
@Nathan
if it is a webserver then you can get access to the crossDomain.xml
but in my case it was just an application with which i should do Socket connection
so that application sends me crossDomain in text format.
followed by "\0".
one more issue was , along withe crossdaomainFile(String) application was sending some more characters thats why it should Syntax error.
when Used "Wireshark" software ,i found that data(crossdomain) was not correct so fixed that and tried and it worked.
thanx all :)
6/2/2011 9:02:25 AM
you are amazing srikanth. This was a tough issue. Good work :)