socket <policy-file-request/>
I see now that Flash 9 requires a policy file to open a socket connection. I can't find any good material on how to setup this policy file. I don't really want to have to create a seperate server (Java) on port 843 and I've read that you can set one up on the socketing-requesting port (6000 in my case). One site I read (http://www.lightsphere.com/dev/artic...et_policy.html) says to simply reply with the following text:
"<cross-domain-policy>
<allow-access-from domain="*" to-ports="*" />
</cross-domain-policy>"
I do get the String request "<policy-file-request/>" from the flash client but when I sent that <cross-domain-policy....reply it did nothing. The socket just sits there waiting.
There other strange thing is that this seems to be a problem with Firefox only. I tried it with IE7 and it makes the request but then keeps on sending/recieving data...even without the policy file reply.
Anyone know more on this topic and how I can get the FF version to work?
Thanks in advance.
Java policy-file-request socket response
I have the exact same problem. The maddening thing is i managed to get this to work a year ago and now that I want to revitalise the project using the same code it doesn't work.
I get the "<policy-file-request/> from the flash to my java server (flash client opens a socket to my domain to a certain port which im listening for on my java written program running on the server.) I then respond with (Java code)
policyBuffer.append("<?xml version=\"1.0\"?><cross-domain-policy>");
policyBuffer.append("<allow-access-from domain=\"*\" to-ports=\"*\" />");
policyBuffer.append("</cross-domain-policy>");
String outputmessage = policyBuffer.toString();
this.output.write(outputmessage);
this outputs what i assume to be the correct statement from crawling for hours through forums. I had a more specific domain rather than '*' before when it was working but tried to see if * would work because it was more vague. All that happens is that the client disconnects. Before when it was working, the client would open up another connection as normal and say hi.
I do not want to write any stupid xml config files and just want to respond to the request with the right string. This is the only thing stopping my Flash network game from launching and is driving me nuts knowing that it was working before and some flash update must have f***ed it up.
An amendment to the code to get this working would be greatly appreciated.
I only have the one server
im hosting the flash swf file, the index page containing the swf, and the Java server program all on one machine. It is annoying that i need this file even though im hosting everything on just the one domain but apparantly you still need it. So i have the one policy file.