Skip to main content

XMPP Webhook Bridge

Project description

Note that xmppwb is currently in early development and may contain bugs.

A bot that bridges XMPP (chats and MUCs) with webhooks, thus making it possible to interact with services outside the XMPP world. This can be used to connect XMPP to other chat services that provide a webhook API (for example Rocket.Chat or Mattermost).


xmppwb requires Python 3.5+ and can be installed using pip3:

$ pip3 install --upgrade xmppwb

which will automatically install the dependencies (aiohttp, pyyaml and slixmpp).


A documented example config is provided in example.conf. A simple config file looks like this (the <placeholders> need to be changed):

  # This JID must exist.
  jid: <>
  password: "<bot-password>"
  # Define all MUCs that should be available to the bridges defined later.
    - jid: <>
      nickname: <nickname>
      # password: "<muc-password>"
  bind_address: ""
  port: 5000
  - xmpp:
      - muc: <>
      - relay_all_normal: true
        - url: <incoming-webhook-url-from-other-end>
          override_username: "{nick}"
        - token: <outgoing-webhook-token-from-other-end>

Note that the password is stored in cleartext, so take precautions such as restricting file permissions. It is recommended to use a dedicated JID for this bridge.

The terminology incoming and outgoing in the config file refers to webhooks from the perspective of this bridge. The webhooks must also be defined on the other end (Rocket.Chat and Mattermost provide a UI for this, for example). An outgoing webhook in Rocket.Chat must be set up in the incoming webhooks section in this bridge and vice versa.

Integrating with Rocket.Chat

An example config for bridging XMPP with Rocket.Chat is provided in rocketchat.example.conf. It is recommended to copy it and fill out all <placeholders>.

  1. To create the corresponding webhooks in RocketChat, go to Administration->Integrations and create a new incoming webhook. Here you can select the channel that you want to bridge with.
  2. After saving, a webhook URL will be generated. Copy it and fill it into the <incoming-webhook-url-from-rocketchat> placeholder in the config file.
  3. Now create an outgoing webhook. The URL is of the form http://{bind_adress}:{port}/ and depends on your settings in the incoming_webhook_listener section. It defaults to
  4. Copy the token and fill it into the <outgoing-webhook-token-from-rocketchat> placeholder.
  5. After having filled out all other placeholders, the bridge is ready to run (see usage).


This bridge is meant to run on the same server as the application you are bridging with, as it currently uses HTTP for incoming webhooks.

To run the bridge:

$ xmppwb --config configfile.conf


$ python3 -m xmppwb --config configfile.conf


$ xmppwb [-h] [-v] --config CONFIG

See also xmppwb --help.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xmppwb-0.2.2.tar.gz (9.3 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page