diff --git a/dashboard/server.mjs b/dashboard/server.mjs index f4b23d7..22ad198 100644 --- a/dashboard/server.mjs +++ b/dashboard/server.mjs @@ -52,6 +52,14 @@ function safeFile(requestUrl) { } } +// Tailscale and similar VPN tunnels show up as extra "LAN" interfaces but are not +// useful for an in-room demo, so keep them out of the printed URL list. +function isTunnelInterface(interfaceName, address) { + if (/^(utun|tailscale|tun|ppp|ipsec)/i.test(interfaceName)) return true; + const [first, second] = address.split(".").map(Number); + return first === 100 && second >= 64 && second <= 127; // 100.64.0.0/10 (CGNAT/tailnet) +} + function displayUrls(host, port) { if (host !== "0.0.0.0") { const displayHost = host === "::" ? "::1" : host; @@ -64,6 +72,7 @@ function displayUrls(host, port) { for (const [interfaceName, addresses] of Object.entries(networkInterfaces())) { for (const address of addresses || []) { if (address.family !== "IPv4" || address.internal || seen.has(address.address)) continue; + if (isTunnelInterface(interfaceName, address.address)) continue; seen.add(address.address); entries.push({ label: `Other devices (${interfaceName})`,