modify:网关配置控制amqtt broker

This commit is contained in:
2026-08-21 09:45:47 +08:00
parent 46ac6a748a
commit 94c50353f4
7 changed files with 321 additions and 28 deletions
+12
View File
@@ -52,6 +52,18 @@ allow_origins = ["*"]
enabled = true
host = "0.0.0.0"
port = 1883
# 是否由网关启动内嵌 amqtt Broker 子进程:
# true (默认)= 网关自带 amqtt Broker,host/port 为 Broker 监听地址
# false = 使用外部 MQTT Broker,网关仅启动 Bridge 客户端连接
# host/port 需指向外部 Broker 地址(如 "192.168.1.10")
use_embedded_broker = true
# MQTT Broker 认证(可选,默认匿名):
# - 内嵌 Broker(use_embedded_broker=true):配置后要求所有客户端(含网关 Bridge)
# 用该账号密码连接,未配置则保持匿名
# - 外部 Broker:网关 Bridge 用该账号密码连接(broker 侧自行配置对应账号)
# 注意:密码为明文存储,生产环境建议使用外部 Broker + 环境变量注入
# username = "chongming"
# password = "change-me"
# MQTT Bridge 额外订阅主题推荐声明在各插件自己的配置里:
# config/workers/<type>/config.toml → [[workers.mqtt_topics]]