0

I have been playing around with node.js and socket.io for the past few days. Everything works fine on my local machine (windows using iss for a webserver), but when uploading it to my remote server (ubuntu box), I get security errors.

[trace] Warning: Failed to load policy file from http://localhost:8000/crossdomain.xml
[trace] *** Security Sandbox Violation ***
[trace] Connection to http://localhost:8000/socket.io/1/ halted - not permitted from http://****/virtualcinema/VirtualCinema.swf
[trace] Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: http://****/virtualcinema/VirtualCinema.swf cannot load data from http://localhost:8000/socket.io/1/.

The AS3 code it's erroring on is:

Security.loadPolicyFile("xmlsocket://localhost:10843");
socket = new FlashSocket("localhost:8000");

The policy file is being served correctly on port 10843 and I can receive the policy file fine at http://**:10843/ in my browser. Why is it trying to load the policy file on port 8000. That warning does not appear on my local build.

The socket.io code:

socket = io.listen(8000);

socket.configure(function() 
{
    socket.set("transports", ["flashsocket"]);
    socket.set("log level", 2);

});

I'm confused as to why it gets resolved fine when I test it on a localmachine but not on a remote one. Any help would be much appreciated :)

The crossdomain.xml I am using:

<cross-domain-policy>
    <allow-access-from domain="*" to-ports="*"/>
</cross-domain-policy>
synergies
  • 71
  • 6
  • The problem is that instead of loading the policy file from xmlsocket://localhost:10843, it loads it from http://localhost:8000/crossdomain.xml which returns "Welcome to socket.io." as that is the port my server is running on. – synergies Apr 01 '13 at 15:21
  • Quick question, are you using a library to talk to your socket.io server from as3 or are you using As3's socket/xmlsockets? – funseiki Aug 05 '13 at 15:40

1 Answers1

1

Fixed. I changed it from pointing to localhost to my servers externalIP.

I had tried this before, but unfortunately the server had cached my swf file and I did not realise it was fixed.

Security.loadPolicyFile("xmlsocket://****.com:10843");
socket = new FlashSocket("****.com:8000");
synergies
  • 71
  • 6