Creates the docker image ridomin/mosquitto-local:dev
to be used when developing MQTT applications locally
It comes with a pre-bundled TLS certificate, exposing TCP and WebSockets on the following ports:
- 1883 - TCP no TLS
- 8883 - TCP with TLS
- 8080 - WebSockets no TLS
- 8443 - WebSockets with TLS
The X509 certificate has been issued by a private CA, you might need to configure your client to trust the CA
docker run -it --rm -p 8080:8080 -p 1883:1883 -p 8883:8883 -p 8884:8884 -p 8443:8443 ridomin/mosquitto-local:dev
Now you can connect with any compatible MQTT client:
mosquitto_pub -h localhost -p 1883 -u user -P password -t test -m hi -d
With username password
mosquitto_pub -h localhost -p 8883 -u user -P password -t test -m hi --cafile ca.crt -d
mosquitto_pub -h localhost -p 8884 --cafile ca.crt --cert mqttclient.cert.pem --key mqttclient.priv.key -t test -m hi -d
Note.
mqttclient.cert
provided for testing
Offers a web server with port details, and the ca cert: [http:/localhost:8080] (http:/localhost:8080)
You might need a websockets compatible client, such as IoT UX for MQTT