Skip to content

Commit

Permalink
More MQTT debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienGllmt committed Jul 29, 2024
1 parent b4e1d81 commit 5449858
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions docs/home/350-game-node-api/100-events/200-low-level-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,25 @@ This example generates the topic `app/foo/bar/{playerId}`

## Debugging

To debug MQTT calls to see if they work correctly, you can use the following tool
To debug MQTT calls to see if they work correctly, you can use the following tools

### mqtt-client-cli

```bash
npm i -g mqtt-client-cli; # only need to install once

mqtt-client-cli ws://localhost:8883;
mqtt-client-cli ws://localhost:8883
# example subscription
sub node/block/#
```
```

#### mqtt.js

```bash
# subscribe to topic
mqtt sub -t 'node/block/#' -h 'ws://localhost:8883' -v
# public to topic
mqtt pub -t 'node/block/#' -h 'ws://localhost:8883' -m '{ msg: "test message" }'
```

See docs [here](https://github.com/mqttjs/MQTT.js/?tab=readme-ov-file#command-line-tools)

0 comments on commit 5449858

Please sign in to comment.