node-bosh-xmpp

Motivation

Are you using node-xmpp for XMPP? But get blocked by coorperate firewalls? Then
node-bosh-xmpp is API compatible with node-xmpp
and gives you the ability to use XMPP over a standard HTTP port.

Credits go to Anoopc

I was looking for a BOSH XMPP client for node and came accross Anoop's node-xmpp-via-bosh implementation.
His code was not completely working for me so I forked his code and fixed the issue I was having. I wanted to be able to specify
the URL of the BOSH server and I also had some issues with the authorization proces.

Installation instructions

npm install node-bosh-xmpp-client

Code instructions

Following you will find the documentation from Anoop which I updated to reflect my changes:

It is inspired by node-xmpp (https://github.com/astro/node-xmpp) and xmppjs(http://github.com/mwild1/xmppjs) and
it is API compatible with node-xmpp (except for the constructor).

It is an xmpp library which lets you establish a persistent session to xmpp server
via a bosh-server and communicate willingly.

an alias for `new ltx.Element(xname, attrs)`
Parameters:
*xname* : [string] name for the xml element
*attrs* : [Object] containing all the attributes to set up
Return value:
a new ltx.Element object

Function: $msg(attrs)

an alias for `new ltx.Element("message", attrs)`
Parameters:
*attrs* : [Object] containing all the attributes to set up
Return value:
a new ltx.Element object

Function: $iq(attrs)

an alias for `new ltx.Element("iq", attrs)`
Parameters:
attrs : [Object] containing all the attributes to set up
Return value:
a new ltx.Element object

Function: $pres(attrs)

an alias for `new ltx.Element("presence", attrs)`
Parameters:
*attrs* : [Object] containing all the attributes to set up
Return value:
a new ltx.Element object

Function: setNoMoreResponse()
Artificially set the OVER state in order to no longer answer or send on this connection.
This is useful if you are taking the rid/jid/sid to another connection and need this one
to stop being 'active' at that time.