Q:

Flash Sockets, securityerror in same domain?

I am trying to connect a flash socket client to a c++ socket server ( using boost::asio ). I always run the server app on the distant server listening on port 7171.
The connection works fine if I run the flash socket client on my local machine ( directly inside CS5.5 ).
After this successful test, I decided to upload my swf to the same machine as the socket server, to allow multiple users to connect it throught HTTP ( then I suppose flash client and c++ server are inside same domain ), but in this case, I always get a SecurityError 2048.
What could I be missing ?

A:

When you test locally you are in your sandbox which will ignore security issues, that is why it will not work when uploaded( outside of sandbox ).

In your ActionScript you need to include this.
// host is something like dev.mydomain.com
Security.allowDomain( host );
Security.loadPolicyFile( "xmlsocket://" host + ":" port );

On the port you need to listen for this request
<policy-file-request/>

When you get the request for the policy you need to return a cross domain policy with with this node.
<allow-access-from domain="*" to-ports="*"  />

