XMPP library

jabber, xmpp
haxelib install hxmpp 1.0.0-alpha.2


alt text

Haxe XMPP/Jabber library | Documentation | Test

The Extensible Messaging and Presence Protocol (XMPP) is an open technology for real-time communication, which powers a wide range of applications including instant messaging, presence, multi-party chat, voice and video calls, collaboration, lightweight middleware, content syndication, and generalized routing of XML data. The XMPP protocols are free, open, public, and easily understandable.


Compiler flags

  • -D xmpp_debug Print XMPP transfer (see jabber.XMPPDebug for options)
  • -D jabber_debug Print verbose debug information
  • -D jabber_component Set to build xmpp server components (use jabber.component.* instead of jabber.client.*)
  • -D jabber_flashsocketbridge Enable to use a flash socket bridge as stream connection for the js/browser target (see hxmpp/util/flash-socketbridge)
  • -D nodejs Set to build for nodejs


BOSH essentially provides a "drop-in" alternative to a long-lived, bidirectional TCP connection using a request-response mechansim over HTTP. To use it you have to connect your client to the BOSH adress of your XMPP server.

Apache, for example, doesn’t know about your XMPP server, therefore you have to forward requests using the proxy module.

ln -s /etc/apache2/mods-available/proxy.load /etc/apache2/mods-enabled/
  • Add following line to proxy.load to activate the module
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
  • Add a directive to your host settings to proxy requests from http://localhost/httpbind to http://localhost:7070/http-bind/
<VirtualHost *:80>
    ProxyRequests Off
    ProxyPass /http-bind http://localhost:7070/http-bind/
    ProxyPassReverse /http-bind http://localhost:7070/http-bind/
  • Restart apache
service apache2 restart
  • You can now use this URL to connect to your server
var cnx = new jabber.BOSHConnection( "server.org", "" );

HXMPP is open source and licensed under MIT | https://github.com/tong/hxmpp

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.