Error #2044: Unhandled SecurityErrorEvent:. text=Error #2048: Security sandbox violation: http://kipos.bluecodestudio.com/holdthebomb/HoldTheBombWeb.swf cannot load data from http://184.108.40.206:8000/socket.io/1/?t=1356891827452. at io::Socket/doHandshake()[/Users/airrider3/github/AS3-Socket.IO-XHR-Polling/xhr-polling/src/io/Socket.as:139] at io::Socket/connect()[/Users/airrider3/github/AS3-Socket.IO-XHR-Polling/xhr-polling/src/io/Socket.as:110] at io::Socket()[/Users/airrider3/github/AS3-Socket.IO-XHR-Polling/xhr-polling/src/io/Socket.as:90] at io::IO$/connect()[/Users/airrider3/github/AS3-Socket.IO-XHR-Polling/xhr-polling/src/io/IO.as:36] at MainController/endOfbluecodeSplash()[/Users/airrider3/Dropbox/Projects/Kipos/Minigames/HoldTheBombWeb/src/MainController.as:41] at bluecodeSplash/endOfSplash()[/Users/airrider3/Dropbox/Projects/Kipos/Minigames/HoldTheBombWeb/src/bluecodeSplash.as:55] at Function/http://adobe.com/AS3/2006/builtin::apply() at com.greensock.core::TweenCore/complete()[D:\_Flash\_AS3\src\com\greensock\core\TweenCore.as:178] at com.greensock::TweenLite/renderTime()[D:\_Flash\_AS3\src\com\greensock\TweenLite.as:477] at com.greensock.core::SimpleTimeline/renderTime()[D:\_Flash\_AS3\src\com\greensock\core\SimpleTimeline.as:93] at com.greensock::TweenLite$/updateAll()[D:\_Flash\_AS3\src\com\greensock\TweenLite.as:642]
I'm using Flash Builder, an ActionScript project, which connects to a server running NodeJS using the Socket.IO module.
To connect Socket.IO with AS3 I'm using the following library https://github.com/sbquinlan/AS3-Socket.IO-XHR-Polling which works perfectly while testing in local, from Flash Builder.
However, if hosted on my domain [http://kipos.bluecodestudio.com/holdthebomb/], I suppose it raises this SecurityErrorEvent because I am not using any crossdomain.xml files correctly? I've never gotten along with this topic, to be honest, so I'm not sure if this is the error.
In any case, I have the following crossdomain.xml file:
<?xml version="1.0"?> <!DOCTYPE cross-domain-policy SYSTEM "/xml/dtds/cross-domain-policy.dtd"> <cross-domain-policy> <site-control permitted-cross-domain-policies="master-only"/> <allow-access-from domain="*" to-ports="*"/> </cross-domain-policy>
I have it in different places on my server. (Should it be on the hosting client?). Yes, the game is hosted on bluecodestudio.com, while the game's server is on the IP 220.127.116.11, running on the port 8000.
If it's the case of the crossdomain policy error, is anyone kind to explain what should be done to fix the problem?
Thanks for your attention.
I set up a server listening on port 843 giving the crossdomain file, but I can see how Flash doesn't try to load it. (I tested the command
python -c 'print "<policy-file-request/>%c" % 0' | nc 18.104.22.168 843 and checked how the policy server indeed works.
How come the SWF doesn't try to load a crossdomain policy file?
Whoa. I just read this on the Socket.IO documentation: "flash policy port defaults to 10843
By default the Socket.IO client will check port 10843 on your server to see if flashsocket connections are allowed. The Adobe Flash Player normally uses 843 as default port, but we decided to default to a non root port."
So that's why it didn't try to load the file from port 843...
Crossdomain policy file should be hosted on machine where the server is running i.e. on the 22.214.171.124. For socket connection flash players automatically try to load master crossdomain policy file from the port 843 (You can get simple policy server script from adobe.com http://www.adobe.com/cn/devnet/flashplayer/articles/socket_policy_files.html)
Security.loadPolicyFile("xmlsocket://126.96.36.199:843"); to load policy file directly, but as I wrote flash player already do the same automatically (for port 843), it sends the string request
To debug the policy server do the following:
Be sure you have the debug flash player.
Check that server installing is correct by the command (linux, mac or cygwin on Windows):
echo -ne '<policy-file-request/>\0' | nc -v host port. This command should print out your crossdomain.xml file
Turn on the flash player policy log by setting the flag
PolicyFileLog=1 in mm.cfg file (be sure you have the debug version of flash player), run swf file and read the policy log, it has user friendly format, you will be able to figure out the problem in most cases by this log.