A primer on Eclipse Mosquitto: Difference between revisions
No edit summary |
|||
| Line 37: | Line 37: | ||
Restart the "Mosquitto Broker" service after making the configuration change, and possibly open the firewall port as needed. | Restart the "Mosquitto Broker" service after making the configuration change, and possibly open the firewall port as needed. | ||
= See Also = | |||
* [[A primer on HiveMQ Broker]] | |||
* [[A primer on Chariot MQTT Server]] | |||
Revision as of 14:30, 1 August 2025
Introduction
Eclipse Mosquitto™ is an open source MQTT broker.
Web site: https://mosquitto.org/
Download: https://mosquitto.org/download/
Documentation: https://mosquitto.org/documentation/
Public broker: https://test.mosquitto.org/
Installation
On Windows, the setup program (by default) installs a Windows service named "Mosquitto Broker". The service is set to start automatically, and is running when the installation completes, thus the MQTT broker can be used immediately. The service can easily be controlled (started, restarted, stopper) from the Services management console.
The installation directory is usually "C:\Program Files\mosquitto".
Configuration
Mosquitto is configured using the mosquitto.conf file in its installation directory.
Remote Access
By default, Mosquitto only allows connections from anonymous clients on the local host. In order to allow anonymous access by remote hosts, use the following in mosquitto.conf:
listener 1883 allow_anonymous true
Restart the "Mosquitto Broker" service after making the configuration change, and possibly open the firewall port as needed.
WebSockets
In order to allow the MQTT broker be accessed via WebSockets (in this example, also using anonymous connections), use the following in mosquitto.conf:
# this will expect websockets connections listener 8080 protocol websockets allow_anonymous true
Restart the "Mosquitto Broker" service after making the configuration change, and possibly open the firewall port as needed.