fix(mqtt): enable clean session and fix hardcoded credentials for gateway
This commit is contained in:
parent
fed81a12f3
commit
47f7cc3c92
@ -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)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user