XIFF with Wildfire: getting crossdomain info over the XML socket?

Hi all,

I’‘m really impressed with XIFF and using it with Wildfire has been really easy for me to set up using Flash Professional 8… except that when I use my web browser to try to connect to the XMPP server at a different domain (since I’‘m hosting it one place and running the .swf from my primary website), I get the security settings warning window. I want to make sure that doesn’'t appear for a user of my website, so I want to host a crossdomain policy file with the Wildfire server.

From the Flash docs:


"Using the xmlsocket protocol along with a specific port number, lets you retrieve policy files directly from an XMLSocket server, as shown in the following example:

System.security.loadPolicyFile(“xmlsocket://foo.com:414”);

…“An XMLSocket server can be configured to serve both policy files and normal XMLSocket connections over the same port, in which case the server should wait for before transmitting a policy file. A server can also be set up to serve policy files over a separate port from standard connections, in which case it can send a policy file as soon as a connection is established on the dedicated policy file port. The server must send a null byte to terminate a policy file, and may thereafter close the connection; if the server does not close the connection, Flash Player does so upon receiving the terminating null byte.”


So I’‘m thinking this is the best way to do it since I am NOT hosting an HTTP server alongside the Wildfire server on that machine, but I wanted to know the best way to go about adding this functionality to Wildire if it isn’'t present, or activating it if it is. Thanks for any help you can give!

Well, I haven’'t been lucky with a crossdomain file as of yet. My Flex app works fine in its build folder (bin) but the XMLSocket object refuses to connect whenever it is being run outside of that bin folder (I assume that I need localTrust in order for this to work without a crossdomain file).

I’'ve added the following crossdomain file to my server:

"<cross-domain-policy>

<allow-access-from domain="*" to-ports=“5222”/>

</cross-domain-policy>"

I’'ve also added the following code before I attempt to call XMPPConnection.Connect():

"Security.loadPolicyFile("http://www.trooker.net/DomainPolicy.xml");"

Still, the XMLSocket in XMPPConnection refuses to connect.

Any ideas?

Message was edited by: kernkraft