Using XMPPBoshConnection?

Hello everyone, I wanted to ask you for help in using the XIFF XMPPBoshConnection class.

I’m trying to use http-bind with ejabberd and I think the XIFF class is incomplete or has little bugs… Let me explain.

First, I noticed that the first XML message sent lacked the “to” field that the protocol specification says it needs. So how can I contact my server without this crucial information ? ^^ So I added this information and then I noticed that my server finally answered me back !

But then ? After this response, the class can do nothing because the server response as only a body node without any child. So in fact, I’m quite stuck and I don’t know what to do.

I need a quick response to evaluate whether I will really be able to use http-bind with XIFF or not. My questions are : do you know if a new version of the class is scheduled and if so, when ? Or maybe you can help me to debug or use this class ? Maybe I miss another crucial information ?



The ‘to’ on the initial packet is optional in BOSH, actually… and empty packets are an expected thing as well. I’m not sure why this isn’t working for you, since I’ve been using it every day. What server are you using?

we are having same problem. we are using ejabberd with xiff library. we had to take out the version attribute from <stream>, that got us started. but still the server just sends back terminate when using xmppsocketconnection with “standard”.

Well, a few weeks later, I still have no responses to the problem. I was not able to work on the topic cause i had to work on another things.

I only know that even with the last file, the problem is still here. At least, I can receive this kind of informations :

<body authid=“2621291746” secure=“true” xmlns:xmpp=“urn:xmpp:xbosh” polling=“2” xmlns=“” requests=“2” from="[HOST_SERVERNAME]" wait=“10” xmlns:stream=“” inactivity=“30” sid=“3275134341c1b6d3aea92b69f2001d89b18622ed” ver=“1.6” maxpause=“120” />

And then ? What should be going on ? What should be called ? Why don’t I receive connection and login events ?

@DavidSmith : we’re using ejabberd 2.0 and the latest sources of XIFF in the trunk repository. I don’t know if the “to” parameter is really optional but anyway, we just can’t get it working.


I have been working on making SparkWeb working on my ejabberd server and finally succeeded by doing some small modification to the XMPPBOSHConnection class.

You can find the patch attached.

xiff_ejabberd.patch (2201 Bytes)


Using the patch posted by dax and the last version (in the trunk svn branch) of XIFF, we finally succeeded in progressing. Now we can connect to our Ejabberd server and login as well. We still face other problems but not XIFF related.

You still have to add a to: and from: parameters in the class to make everything working correctly.

im having trouble connecting to an ejabberd server like from a webserver instance of flash.

it works fine locally, but not on a webserver, even with all the crossdomain setup properly, and throwing no errors.

how do you install this patch?

the connection error i get is Auth 401.

thanks in advance.



  • First, be sure to download the latest source files of XIFF. Those can be found on the SVN in the “trunk” branch.

  • Then, to apply the patch, just open the patch file and report the few updates in your own files. (Maybe there is a way to apply them automatically, but anyway…)

  • Finally, do not forget to add two other parameters in the packets sent, that is to say “to” and “from” without those informations, the class won’t behaviour at all as expected.

But for now, we only tested locally. We did not test our application once uploaded on the webserver. But at least, we know that the XMPPBosh is working ^

May I ask you how you handled policy files issues ?

As far as we’re concerned, everything is nearly fine. We succeeded in taking care of policy files and crossdomain issues and the class XMPPBoshConnection is working pretty well…

Well, pretty only cause now, we faced an error that randomly appears… We know that it is sent by the HTTPService error callback method “httpError” and when tracing a bit, we can see it seems to be an error with URLLoader and an Error #2032.

It seems to be a bug from Flash and there seems to have lots of informations on Google but I would like to know if someone in here faced the problem. And it also seems that I never encounter the bug anymore when upgraded to Flash 9.0.124 (whereas there are too many issues with sockets connections).


It seems we’re not done yet with BOSH.

Everything worked great until we noticed that the registration process fails when using XMPPBoshConnection. I’d not be surprised of another bug or lack of informations in the class but anyway, we can only register new users if using XMPPSocketConnection object. If we don’t and use BOSH, we receive a failure and an error.

<body xmlns="[]"><iq

from=“” id=“reg_attempt_1”

xmlns=“jabber:client” type=“result”><query

xmlns=“jabber:iq:register”><username>testpwd</username><passwo rd>testpwd</password></query></iq*><failure



What is also strange is that XIFF is triggering a RegistrationSuccessEvent (but XMPP object is not connected so the registration failed) before the XiffErrorEvent.

If someone has an answer…