feat: add turn-ready node p2p config

This commit is contained in:
lpf
2026-03-08 23:12:29 +08:00
parent 3db78e0577
commit f441972c56
13 changed files with 384 additions and 29 deletions

View File

@@ -200,6 +200,52 @@ Notes:
See [config.example.json](/Users/lpf/Desktop/project/clawgo/config.example.json) for a full example.
## Node P2P
The remote node data plane supports:
- `websocket_tunnel`
- `webrtc`
It remains disabled by default. Node P2P is only enabled when `gateway.nodes.p2p.enabled=true` is set explicitly. In practice, start with `websocket_tunnel`, then switch to `webrtc` after validating connectivity.
For `webrtc`, these two fields matter:
- `stun_servers`
- legacy-compatible STUN list
- `ice_servers`
- the preferred structured format
- may include `stun:`, `turn:`, and `turns:` URLs
- `turn:` / `turns:` entries require both `username` and `credential`
Example:
```json
{
"gateway": {
"nodes": {
"p2p": {
"enabled": true,
"transport": "webrtc",
"stun_servers": ["stun:stun.l.google.com:19302"],
"ice_servers": [
{
"urls": ["turn:turn.example.com:3478"],
"username": "demo",
"credential": "secret"
}
]
}
}
}
}
```
Notes:
- when `webrtc` session setup fails, dispatch still falls back to the existing relay / tunnel path
- Dashboard, `status`, and `/webui/api/nodes` expose the current Node P2P runtime summary
## MCP Server Support
ClawGo now supports `stdio`, `http`, `streamable_http`, and `sse` MCP servers through `tools.mcp`.