view mod_pubsub_mqtt/README.markdown @ 3088:6eaa1aa4f8ae

mod_cloud_notify: more cleanup
author tmolitor <>
date Sat, 02 Jun 2018 03:09:42 +0200
parents 4d73a1a6ba68
children 2333e384409d
line wrap: on
line source

- 'Stage-Beta'
summary: 'MQTT interface to Prosody''s pubsub'


[MQTT]( is a lightweight binary pubsub protocol suited
to embedded devices. This module provides a way for MQTT clients to
connect to Prosody and publish or subscribe to local pubsub nodes.


MQTT has the concept of 'topics' (similar to XMPP's pubsub 'nodes').
mod\_pubsub\_mqtt maps pubsub nodes to MQTT topics of the form
`HOST/NODE', e.g.`\`.

### Limitations

The current implementation is quite basic, and in particular:

-   Authentication is not supported
-   SSL/TLS is not supported
-   Only QoS level 0 is supported

### Payloads

XMPP payloads are always XML, but MQTT does not define a payload format.
Therefore mod\_pubsub\_mqtt will attempt to convert data of certain
recognised payload types. Currently supported:

-   JSON (see [XEP-0335]( for
    the format)
-   Plain UTF-8 text (wrapped inside
    `<data xmlns=""/>`)

All other XMPP payload types are sent to the client directly as XML.
Data published by MQTT clients is currently never translated, and always
treated as UTF-8 text.


There is no special configuration for this module. Simply load it on
your pubsub host like so:

    Component "" "pubsub"
        modules_enabled = { "pubsub_mqtt" }

You may also configure which port(s) mod\_pubsub\_mqtt listens on using
Prosody's standard config directives, such as `mqtt_ports`. Network
settings **must** be specified in the global section of the config file,
not under any particular pubsub component. The default port is 1883
(MQTT's standard port number).


  ------- --------------
  trunk   Works
  0.9     Works
  0.8     Doesn't work
  ------- --------------