Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soypat/natiu-wsocket
MQTT websocket implementation using natiu-mqtt.
https://github.com/soypat/natiu-wsocket
mqtt mqtt-client mqtt-protocol mqtt-websocket websocket
Last synced: 4 months ago
JSON representation
MQTT websocket implementation using natiu-mqtt.
- Host: GitHub
- URL: https://github.com/soypat/natiu-wsocket
- Owner: soypat
- License: mit
- Created: 2022-12-13T13:01:58.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-22T15:19:25.000Z (about 2 years ago)
- Last Synced: 2024-06-20T16:35:04.866Z (8 months ago)
- Topics: mqtt, mqtt-client, mqtt-protocol, mqtt-websocket, websocket
- Language: Go
- Homepage:
- Size: 40 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wsmqtt
MQTT websocket implementation using [natiu-mqtt](https://github.com/soypat/natiu-mqtt).## Simplicity
It took 255 lines of code to get the first `cmd/mqttping` up and working.
The wsocket package itself was 171 lines at that point.## `cmd/mqttping`
Program for server discovery and uptime checker. See [`mqttping.go`](./cmd/mqttping/mqttping.go).Example output shown below. Network cable unplugged after 6 seconds of runtime.
```
mqttping -url=ws://dashboard.ci/qa -u=username -pass=123 -keepalive=10s
2022/12/14 15:20:18 connection success
2022/12/14 15:20:19 Ping OK (1.003365536s)
2022/12/14 15:20:20 Ping OK (1.003063079s)
2022/12/14 15:20:21 Ping OK (1.004336657s)
2022/12/14 15:20:22 Ping OK (1.003325537s)
2022/12/14 15:20:23 Ping OK (1.003230131s)
2022/12/14 15:20:33 ping failed:failed to get reader: received continuation frame without text or binary frame
```