A simple Ruby server to provide a gateway between HTTP and XMPP



XMPP Gateway provides a HTTP interface to talking to an XMPP server. It is designed to speed up and simplify communications between a web app and a generic XMPP server. It achieves this by taking care of the XMPP connection management, and allowing the sending and receiving of replies via a very simple synchronous HTTP interface.

HTTP Basic Authentication is used to provide the credentials for authenticating an XMPP session. An XMPP stanza can then be sent by making a HTTP Post (see 'Operation' below).

There are 3 stanza types in XMPP: IQ, message and presence. IQ always expects a reply, and this will be returned in the body of the HTTP response. Message and presence are purely fire and forget.

Currently it is not production ready and merely a proof of concept.


  • ruby 1.9.2


To install the gems

$ gem install xmpp_gateway

To start the server

$ xmpp_gateway --debug

Server should now be available on

To send a message:

$ curl --user YOURNAME@jabber.org:PASSWORD --data "stanza=<message to='theozaurus@jabber.org'><body>Howdy</body></message>"

To send an IQ:

$ curl --user YOURNAME@jabber.org:PASSWORD -d "stanza=<iq to='jabber.org'><query xmlns='http://jabber.org/protocol/disco#info'/></iq>"
<iq type="result" id="blather0007" from="jabber.org" to="theozaurus@jabber.org/457fd1b2e49ebb39">
  <query xmlns="http://jabber.org/protocol/disco#info">
    <identity category="server" type="im" name="Isode M-Link 14.6a6"/>
    <identity category="pubsub" type="pep"/>
    <feature var="http://jabber.org/protocol/disco#info"/>
    <feature var="http://jabber.org/protocol/disco#items"/>
    <feature var="urn:xmpp:ping"/>
    <feature var="vcard-temp"/>
    <feature var="http://jabber.org/protocol/commands"/>
    <feature var="http://jabber.org/protocol/compress"/>
    <feature var="jabber:iq:auth"/>
    <feature var="jabber:iq:private"/>
    <feature var="jabber:iq:version"/>
    <feature var="http://jabber.org/protocol/pubsub#access-presence"/>
    <feature var="http://jabber.org/protocol/pubsub#auto-create"/>
    <feature var="http://jabber.org/protocol/pubsub#auto-subscribe"/>
    <feature var="http://jabber.org/protocol/pubsub#create-nodes"/>
    <feature var="http://jabber.org/protocol/pubsub#filtered-notifications"/>
    <feature var="http://jabber.org/protocol/pubsub#publish"/>
    <feature var="http://jabber.org/protocol/pubsub#retrieve-items"/>
    <feature var="http://jabber.org/protocol/pubsub#subscribe"/>


  • Test suite
  • Add HTTP callbacks so that asynchronous events can be fed back to the HTTP server
  • HTTPS support