fix(web): make STUN URL configurable, default empty (#179)#472
Merged
intendednull merged 1 commit intoApr 28, 2026
Merged
Conversation
Hardcoded `stun:stun.l.google.com:19302` leaked every voice-call participant's public IP to Google. Replace it with a configurable list that defaults to empty — voice ICE now relies on host candidates plus the iroh relay path, so no third-party server learns the user's IP unless the deployment opts in. Knob: `window.__WILLOW_STUN_URLS = ['stun:host:port', ...]`, mirroring the existing `window.__WILLOW_RELAY_URL` override pattern in `crates/web/init.js` / `app.rs::resolve_relay_url`. `init.js` ships the override commented out alongside an example for restoring Google STUN or pointing at a self-hosted server. Brainstorm: chose the JS window global (Option A) over a build-time env var (rebuild-required, less flexible) and over a query-string override (exposed in URLs/logs, doesn't match the existing pattern). Tests (`crates/web/tests/browser.rs::stun_config`): - default `resolve_stun_urls()` returns empty Vec - override populates the Vec - default `RTCConfiguration` has no `iceServers` entries - override surfaces the supplied URL in the config Scope: short-term fix only. Self-hosted STUN (medium-term) and iroh-relay-based ICE traversal (long-term) tracked under #179. Refs #179
This was referenced Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
what
big rock:
voice.rshadstun:stun.l.google.com:19302hardcoded. every voice call shouted user IP at Google. bad.now: STUN list come from
window.__WILLOW_STUN_URLS. default = empty. empty list = no third-party STUN = no leak. voice ICE use host candidates + iroh relay path.want Google STUN back? set the global. want self-host STUN? set the global.
init.jshas commented example.why
privacy. fix #179 short-term rock. metadata leak gone by default. user must opt in to leak.
brainstorm
three rocks considered:
window.__WILLOW_STUN_URLSJS global — match existingwindow.__WILLOW_RELAY_URLrock. easy override, no rebuild. picked.verify
cargo fmt --check— cleancargo clippy --workspace --all-targets -- -D warnings— zero warningscargo test --workspace— all greencargo check --target wasm32-unknown-unknown -p willow-web— cleanbrowser test runner (geckodriver/firefox) not in this env. tests added at
crates/web/tests/browser.rs::stun_config:resolve_stun_urls()returns emptyRTCConfigurationhas emptyiceServerscompile on wasm32 verified — runtime assertions will run on PR CI /
just test-browser.tradeoff
iceServers? config still set explicitly to empty array (not undefined), which is spec-legal. if breaks, fallback rock = ship a self-hosted STUN default — file as follow-up if observed.scope
short-term rock only. medium-term (self-host STUN) and long-term (iroh relay ICE) stay open under #179.
Refs #179
Generated by Claude Code