powered by Jive Software

Getting XIFF3.0 to connect to Openfire/Wildfire in a remote sandbox

It took me a while to figure this out, but since Flash has a lot of Sandbox issues, a chat client created in Flex will not connect to your jabber server if the sandbox type is anything other than LocalTrusted (correct me if I am missing some exceptions). One possible way to fix this is to install a webserver, such as Tomcat or IIS on your chat server, and stick a crossdomain.xml file in the root.

It does not need to be in the root though, and if it is not, you will need to define in your flex code where it is with:

Security.loadPolicyFile(“location-of-crossdomain.xml”);

Make sure that line of code is executed during the initialize event of the Application. Something like:

<?xml version=“1.0” encoding=“utf-8”?>

<mx:Application xmlns:mx=“http://www.adobe.com/2006/mxml

layout=“vertical” width=“100%” height=“100%”

initialize=“init()”>

<mx:Script>

<![CDATA[

import flash.system.Security;

public function init():void{

Security.loadPolicyFile(“http://wmc02/crossdomain.xml”);

}

Yeah, i’m still not sure if that will work. Since you are running with XIFF 3.0 which uses XMLSockets, you will need to server up your domain policy file through a socket via the XMLSocket and not via http. I had to do this with SparkWeb (Flex), by creating a new socket that distributed the cross-domain.xml file out of the enterprise plugin.

Cheers,

Derek

I was able to get it work using that method. Though I’m going to try the XMLSocket method, as it sounds like it may be a better solution and eliminates the need for a webserver to be running on the server in addition to an Openfire server. But what did you mean by “enterprise plugin?”