diff --git a/mqtt-gateway/main.go b/mqtt-gateway/main.go index 46e70d7..714b018 100644 --- a/mqtt-gateway/main.go +++ b/mqtt-gateway/main.go @@ -47,9 +47,9 @@ func main() { opts := mqtt.NewClientOptions() opts.AddBroker(cfg.MQTTAddr) opts.SetClientID(cfg.MQTTClientID) - opts.SetUsername("star-cloud-gateway") - opts.SetPassword("StarCloudSecret999") // 與 Redis 中的 hash 對應 - opts.SetCleanSession(false) + opts.SetUsername(cfg.MQTTUser) + opts.SetPassword(cfg.MQTTPassword) + opts.SetCleanSession(true) opts.SetAutoReconnect(true) opts.SetMaxReconnectInterval(10 * time.Second)