View Full Version : Web Server, Socket Server and Security sandbox violation

02-17-2009, 06:26 AM
Hi all,

I am writing an chat program based on flex and darkstar. And I have host the release build of this application in Tomcat. Here is my crossdomain.xml:
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM

<allow-http-request-headers-from domain="*" headers="*" secure="false"/>
<site-control permitted-cross-domain-policies="all" />
<allow-access-from domain="*" to-ports="1139"/>

I can access this file through http://localhost:8080/crossdomain.xm. But when I browse the page with socket connection, it turns out with Error #2048: Security sandbox violation. However, I can browse the page through flex builder run. But the one in bin-release folder doesn't work neither.
Here is part of the code in the chat client:

var ipAddress:String = "localhost";
sock.addEventListener(Event.CLOSE, onClose);
sock.addEventListener(Event.CONNECT, onConnect);

Is there any solution to this? I have reviewed many threads, but still can't work it out. Can anyone help me? Many thanks.