MQTT

“a publish-subscribe-based messaging protocol”

brew install mosquitto
ln -sfv /usr/local/opt/mosquitto/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mosquitto.plist

mosquitto_sub -t topic/state

mosquitto_pub -t topic/state -m "Hello World"