https://github.com/bytespider/mqtt-debug
Eavesdrop on communication between an MQTT client and broker and log the output to the console
https://github.com/bytespider/mqtt-debug
Last synced: 4 months ago
JSON representation
Eavesdrop on communication between an MQTT client and broker and log the output to the console
- Host: GitHub
- URL: https://github.com/bytespider/mqtt-debug
- Owner: bytespider
- License: isc
- Created: 2021-12-06T13:36:22.000Z (over 4 years ago)
- Default Branch: develop
- Last Pushed: 2021-12-10T11:07:39.000Z (over 4 years ago)
- Last Synced: 2025-10-06T00:26:53.557Z (9 months ago)
- Language: JavaScript
- Size: 33.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# mqtt-debug
> Eavesdrop on communication between an MQTT client and broker
[](https://github.com/bytespider/mqtt-debug/actions/workflows/npm-publish.yml)
MQTT-Debug leans heavily on the work of [mqtt-spy](https://github.com/jdiamond/mqtt-spy), but it's raw packet packet output wasn't enough.
## Install
```
npm install --global mqtt-debug
```
## Run
```
mqtt-debug 3883 mqtt.example.com 1883
```
## TLS Example
```
mqtt-debug --cert path/to/crt --key path/to/key --up-cert path/to/crt --up-key path/to/key 8883 mqtt.example.com 8883
```
## Docker
If you want to use docker, you can. Inside the repo:
### Build
```shell
docker build . -t mqtt-debug
```
### Run
#### Using the built in certificates:
The following self-signed certificates are provided for you:
- /certs/ca.pem
- /certs/cert.pem
- /certs/key.pem
```shell
docker run --rm -it -p 8883:8883 mqtt-debug --ca certs/ca.pem --cert certs/cert.pem --key certs/key.pem --up-cert certs/cert.pem --up-key certs/key.pem 8883 mqtt.example.com 8883
```
#### Using custom certificates:
Mount a custom /certs directory.
```shell
docker run --rm -it -p 8883:8883 -v $(pwd)/local-certs:/certs mqtt-debug mqtt-debug --ca certs/myca.pem --cert certs/myserver.pem --key certs/myserver-key.pem --up-cert certs/myclient.pem --up-key certs/myclient-key.pem 8883 mqtt.example.com 8883
```