VA-10: push WebRTC ICE config to agent + browser #56

Merged
nrupard merged 2 commits from feat/VA-10-webrtc-ice-push into main 2026-06-12 23:27:38 +02:00
Owner

Summary

Server side of the WebRTC data-channel tunnel upgrade (VA-10; agent side: vervain-agent PR). The agent and the browser both need the domain's ICE (STUN/TURN) servers to negotiate the data channel; this wires one config source to both.

What changed

  • meshcentral-config: new Domain::ice_servers field, read from the iceservers domain key (raw JSON array of RTCIceServer objects; array-typed only).
  • meshcentral-web agent channel: on agent authentication, push {"action":"webrtcconfig","iceServers":[...]} to the agent over its control channel (fire-and-forget; the agent caches it and falls back to host candidates when absent).
  • meshcentral-web serverinfo: surface the same config to the browser as webrtcconfig (wrapped as an RTCConfiguration object), which agent-redir-ws-0.1.1.js feeds to new RTCPeerConnection(...).

Follow-up (not in this PR)

Browser SPA, needs live-browser QA: flip attemptWebRTC on and consume serverinfo.webrtcconfig in the redirect setup so the browser actually offers the upgrade.

Validation

clippy --deny warnings and the serverinfo tests pass on the touched crates.

Refs VA-10.

## Summary Server side of the WebRTC data-channel tunnel upgrade (VA-10; agent side: vervain-agent PR). The agent and the browser both need the domain's ICE (STUN/TURN) servers to negotiate the data channel; this wires one config source to both. ## What changed - `meshcentral-config`: new `Domain::ice_servers` field, read from the `iceservers` domain key (raw JSON array of `RTCIceServer` objects; array-typed only). - `meshcentral-web` agent channel: on agent authentication, push `{"action":"webrtcconfig","iceServers":[...]}` to the agent over its control channel (fire-and-forget; the agent caches it and falls back to host candidates when absent). - `meshcentral-web` serverinfo: surface the same config to the browser as `webrtcconfig` (wrapped as an `RTCConfiguration` object), which `agent-redir-ws-0.1.1.js` feeds to `new RTCPeerConnection(...)`. ## Follow-up (not in this PR) Browser SPA, needs live-browser QA: flip `attemptWebRTC` on and consume `serverinfo.webrtcconfig` in the redirect setup so the browser actually offers the upgrade. ## Validation clippy --deny warnings and the serverinfo tests pass on the touched crates. Refs VA-10.
feat(webrtc): push ICE config to agent + browser for data-channel upgrade
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 2m18s
66a90fdc74
Server side of the WebRTC data-channel tunnel upgrade (VA-10, vervain-agent). The agent and the browser both need the domain's ICE (STUN/TURN) servers to negotiate the data channel; this wires a single config source to both.

- `meshcentral-config`: new `Domain::ice_servers` field, read from the `iceservers` domain key (raw JSON array of `RTCIceServer` objects), array-typed only.
- `meshcentral-web` agent channel: on agent authentication, push `{"action":"webrtcconfig","iceServers":[...]}` to the agent over its control channel (fire-and-forget; the agent caches it and falls back to host candidates when absent).
- `meshcentral-web` serverinfo: surface the same config to the browser as `webrtcconfig` (wrapped as an `RTCConfiguration` object), which `agent-redir-ws-0.1.1.js` feeds to `new RTCPeerConnection(...)`.

Follow-up (browser SPA, not in this PR, needs live-browser QA): flip `attemptWebRTC` on and consume `serverinfo.webrtcconfig` in the redirect setup so the browser actually offers the upgrade.

Verified: clippy --deny warnings and the serverinfo tests pass on the touched crates.

#VA-10

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
fix(webrtc): resolve agent ICE config by its own domain
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
Check / fmt + clippy + build + tests (pull_request) Successful in 1m54s
f1f59309d4
Review follow-up (PR #56): `push_webrtc_config` hardcoded the default domain (`config.domain("")`), so a multi-domain deployment would push the default domain's ICE servers to every agent while the browser (`serverinfo::from_domain`) got its actual domain's. Derive the domain from the agent's `node//<domain>/<hash>` id instead (empty for the default domain, unchanged for current single-domain node ids), matching the browser path.

#VA-10

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
nrupard deleted branch feat/VA-10-webrtc-ice-push 2026-06-12 23:27:38 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/vervain-server!56
No description provided.