diff mod_pubsub_mqtt/README.markdown @ 5833:58df53eefa28

mod_pubsub_mqtt: Update to MQTT 3.1.1
author Matthew Wild <mwild1@gmail.com>
date Wed, 07 Feb 2024 11:57:30 +0000
parents 2333e384409d
children
line wrap: on
line diff
--- a/mod_pubsub_mqtt/README.markdown	Tue Jan 30 14:26:14 2024 +0000
+++ b/mod_pubsub_mqtt/README.markdown	Wed Feb 07 11:57:30 2024 +0000
@@ -11,35 +11,38 @@
 to embedded devices. This module provides a way for MQTT clients to
 connect to Prosody and publish or subscribe to local pubsub nodes.
 
+The module currently implements MQTT version 3.1.1.
+
 Details
 -------
 
 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.`pubsub.example.org/mynode`.
+`<HOST>/<TYPE>/<NODE>`, e.g.`pubsub.example.org/json/mynode`.
+
+The 'TYPE' parameter in the topic allows the client to choose the payload
+format it will send/receive. For the supported values of 'TYPE' see the
+'Payloads' section below.
 
 ### 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:
+Therefore mod\_pubsub\_mqtt has some built-in data format translators.
+
+Currently supported data types:
 
--   JSON (see [XEP-0335](http://xmpp.org/extensions/xep-0335.html) for
-    the format)
--   Plain UTF-8 text (wrapped inside
+-   `json`: See [XEP-0335](http://xmpp.org/extensions/xep-0335.html) for
+    the format.
+-   `utf8`: Plain UTF-8 text (wrapped inside
     `<data xmlns="https://prosody.im/protocol/mqtt"/>`)
-
-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.
+-   `atom_title`: Returns the title of an Atom entry as UTF-8 data
 
 Configuration
 -------------
@@ -51,16 +54,15 @@
         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).
+Prosody's standard config directives, such as `mqtt_ports` and
+`mqtt_tls_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) and 8883 for TLS connections.
 
 Compatibility
 -------------
 
   ------- --------------
   trunk   Works
-  0.9     Works
-  0.8     Doesn't work
+  0.12    Works
   ------- --------------