Ok, sorry for taking some time to answer the posts, I wanted to test everything I could but I run out of ideas, It doesnt works, so lets explain again the situation:
I have a flash game that connects to my server (python app coded by me with sockets listening in port 50000). My game multiplayer feature
works perfectly when I run the server in the localhost, but when I run it on my host, flash doesnt want to connect.
I connect using this:
socket = new Socket(host,port);
socket.addEventListener(Event.CONNECT, onConnect);
socket.addEventListener(Event.CLOSE, onClose);
socket.addEventListener(IOErrorEvent.IO_ERROR, onError);
socket.addEventListener(ProgressEvent.SOCKET_DATA, onResponse);
socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);
And the security error message jumps every time. So Security Sandbox Problem. I read about crossdomain.xml and tryed to fix the problem.
I have a http server running on my host (in port 80), so I added the
crossdomain.xml to my http server root folder, expecting the flash to ask for the file before stablising any connection.
I was worryed that if Im going to connect through a socket to port 50000 probably flash will ask for the policy file to that port, so I tryed to force flash to ask the policy file from port 80.
Security.loadPolicyFile("http://" + server_host + "/crossdomain.xml");
It loads the security file, throws some warnings on the console related to using 'secure' in a http connection, and something about meta-policy and 'master-only'. But the connection problem persist.
Then I discovered that the socket in my server was being opened but receiving a message that I didnt send from my flash client, the message was this: '<policy-file-request/>'
So I guessed that if I response to that request with a message containing the policy file all will be solved (and the documentation says so), so I send my policy file through my socket dumping the next string on the socket:
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="*" to-ports="*" secure="false"/>
</cross-domain-policy>
Then the host closes the socket (which is the expected behaviour) but my flash console says that the file sintax is wrong so no policies applied.
End of the story
So please, can anybody enlighten me here?