Env : Mac OS 10.12.3
1. visit official website
https://mosquitto.org/download/
2. follow this description.
a : must install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
b : install mosquitto
brew install mosquitto
3. Running mosquitto
a. execute mosquitto (if u have mosquitto.conf , otherwise , del -c argument )
/usr/local/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
b. mosquitto_sub
mosquitto_sub -v -t "topictest"
c. mosquitto_pub
mosquitto_pub -t "topictest" -m "hello"
留言
張貼留言