Mosquitto是一个开源的mqtt规则的具体实现库,mosquitto是一个轻量级的lightweight实现库,同时支持几乎全部的系统。git
从命令行运行下面的命令,命令完成以后就已经安装完成brewgithub
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"ruby
$ brew doctorcurl
$ brew pruneui
$ brew install mosquittourl
$ ln -sfv /usr/local/opt/mosquitto/*.plist ~/Library/LaunchAgents命令行
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mosquitto.plisthomebrew
$mosquitto_sub -h 127.0.0.1 -t topicget
qt