|
|
@ -15,7 +15,7 @@ func main() {
|
|
|
|
options := mqtt.NewClientOptions()
|
|
|
|
options := mqtt.NewClientOptions()
|
|
|
|
options.AddBroker(fmt.Sprintf("tcp://%s:%s", *common.BrokerHost, *common.BrokerPort))
|
|
|
|
options.AddBroker(fmt.Sprintf("tcp://%s:%s", *common.BrokerHost, *common.BrokerPort))
|
|
|
|
|
|
|
|
|
|
|
|
// options.SetClientID("go_mqtt_client")
|
|
|
|
options.SetClientID("go_mqtt_pub_client")
|
|
|
|
options.SetUsername("dirp")
|
|
|
|
options.SetUsername("dirp")
|
|
|
|
options.SetPassword("dirp")
|
|
|
|
options.SetPassword("dirp")
|
|
|
|
options.SetDefaultPublishHandler(func(client mqtt.Client, msg mqtt.Message) {
|
|
|
|
options.SetDefaultPublishHandler(func(client mqtt.Client, msg mqtt.Message) {
|
|
|
|