mosquitto 代理服务的安装/发布与订阅

/ 默认分类 / 没有评论 / 91浏览
brew install mosquitto

默认配置文件

/usr/local/etc/mosquitto/mosquitto.conf

通过开机自启

brew services restart mosquitto

或者通过手动启动

/usr/local/opt/mosquitto/sbin/mosquitto -c /usr/local/etc/mosquitto/mosquitto.conf

发布消息

mosquitto_pub -t topic -m message -q 1

订阅消息

mosquitto_sub -t topic -c -i id -q 1