Files

14 lines
898 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ADS 控制中心与中继(Go)
`main.go` / `cluster.go` 是 ads-server 控制中心。`go build -o ads-server .`。
配置 ADS_AGENT_TOKEN、ADS_CLIENT_TOKEN(不同且至少 32 字符);默认回环监听,可用 --listen 修改。
加上 `--cluster-config /etc/ads/cluster.json` 和至少 32 字符的 ADS_RELAY_SECRET 启用 v2:控制中心负责注册、独占租约、SDP 信令与节点健康,不转发 v2 ADB 数据。未配置集群则保留 v1 数据转发。公网使用有效证书或 HTTPS 反向代理。
| 内部目录 | 用途 | 语言 |
| --- | --- | --- |
| `cmd/ads-relay/` | 独立节点入口,`go build -o ads-relay ./cmd/ads-relay` | Go |
| `internal/relay/` | HMAC 票据、WSS 配对、撤销、可选 STUN 和测试 | Go |
集群配置、角色、协议及部署见 [集群说明](../docs/cluster.md)。执行 `go test -race ./...` 检查并发行为。