15 August 2012

Strophe fix for JabberHttpBindingServlet

Strophe.js is best xmpp bosh library , but we found problem with JabberHttpBindingServlet connection ,i tried lot of hours for searching the solution from google , but no luck ,so myself dig the code after nearly one hour i got it . The problem is JHBServlet is expeting child node or empty child node form XMPP_RESTART body tag,but strophe is sending self-closed body tag

Solution : strophe.js

   if (this._data[i] === "restart") {
            body.attrs({
             to: this.domain,
             "xml:lang": "en",
             "xmpp:restart": "true",
             "xmlns:xmpp": Strophe.NS.BOSH
            });
              body.t(' ');  //Solution                       
          } else {
             body.cnode(this._data[i]).up();
          }

or download modified source Strophe.js