Files
tailscale/flakehashes.json
T
Adriano Sela Aviles 9d7a6f474e wgengine,feature: add optional webrtc path to magicsock
Add an optional WebRTC connectivity path to magicsock, primarily so
browser (js/wasm) nodes, which cannot open raw UDP sockets, can reach
peers directly instead of always relaying through DERP.

The implementation lives in a new feature/webrtc package that plugs into
magicsock through a hook, so magicsock itself keeps no dependency on
pion/WebRTC. The feature is opt-in: it is linked in only when a program
blank-imports feature/webrtc, and its init registers the manager via
magicsock.HookNewWebRTCManager. When it is not linked, the hook stays
unset and the WebRTC path is absent.

Signaling reuses the existing disco/DERP path rather than a standalone
server: offers, answers, and ICE candidates travel as a single new
TypeWebRTCSignal disco message, so no external signaling server is
needed. Once a data channel is up it appears to the rest of magicsock as
a peer path at the WebRTCMagicIP (127.3.3.41) address, ranked above DERP
but below direct UDP. WebRTC is only attempted when at least one side is
a js node, so native-to-native peers are unaffected.

TS_DEBUG_NEVER_DIRECT_WEBRTC disables the path at runtime for debugging,
falling back to DERP.

Updates #21027

Signed-off-by: Adriano Sela Aviles <[email protected]>
2026-09-03 06:40:03 -04:00

11 lines
300 B
JSON

{
"toolchain": {
"rev": "c46f95b7f7c2ebe520044ef131d6ce730d7e4a82",
"sri": "sha256-+cTlDLusJthxTayVx6yGoqZHRN4ylvs/9Qpy4P2dlDI="
},
"vendor": {
"goModSum": "sha256-K7mRip/r5JfH5FVlh8/+uVrfK7S/CxNZjhDDU0KNy+8=",
"sri": "sha256-GbGSMlWdOJb4PjyFBjaHKKjkp9M5XWPn4Bkv4BBlZRw="
}
}