soypat / natiu-wsocket

MQTT websocket implementation using natiu-mqtt.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wsmqtt

MQTT websocket implementation using 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.

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

About

MQTT websocket implementation using natiu-mqtt.

License:MIT License


Languages

Language:Go 100.0%