Implemented MQTT on Javascript client with asynchronouse, using server broker demo from HiveMQ
Run on two different terminal, first run subscribe node and then publish
-
you can subscribe topic with calling js file bellow :
node subscribe.js
Fill the topic name what you want, and the topic name must same between subsribe and publish
-
you can publish message to topic with calling js file bellow :
node publish.js
Fill the topic name and message what you want, don't forget topic name must same with subscribe