# config.yml server: app_listen_port: ":8089" device_listen_port: ":7002" # [重要] 注册到 Redis 的公网地址 public_app_addr: "192.168.5.193:8089" public_device_addr: "192.168.5.193:7002" instance_id: "" # 留空会自动生成 # 速率限制配置 rate_limit: enabled: true # 是否启用限流 # 下载速率限制(从 relay-server -> App),单位 MB/s download_mbps: 1.5 # 上传速率限制(从 App -> relay-server),单位 MB/s upload_mbps: 1.5 # 令牌桶的“桶”大小,单位 KB。 # 允许的瞬时突发流量。建议是速率的 1-2 倍。 # 例如,1 MB/s 的速率,可以设置 1024-2048 KB 的桶大小。 burst_kb: 1536 # 认证密钥配置 auth: enabled: true app_access_secret: "D4tBb9Y0oHSXRAyHLHpdKfXAuNCyCZ45AZxKJOhMJMs=" device_relay_secret: "p+JtJ8aHlM1lDYu7UGFanX8ALVt1pM1BQmKTpqTJccs=" redis: enabled: true addr: "118.178.183.78:6379" password: "" db: 0 # [新增] 服务发现相关的 Key 和 TTL # 使用 Redis Hash: Key 是 instance_registry_key, Field 是 instance_id, Value 是实例信息的 JSON instance_registry_key: "relay_instances" device_relay_mapping_key: "device_relay_mapping" heartbeat_interval_seconds: 15 instance_ttl_seconds: 45 # TTL 应该是心跳间隔的 2-3 倍