Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions apps/desktop/src/backend/DesktopServerExposure.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,26 @@ describe("DesktopServerExposure", () => {
),
);

it.effect("advertises the Wi-Fi address ahead of Windows Hyper-V switches", () =>
withHarness(
{
Tailscale: [{ address: "100.64.0.5", family: "IPv4", internal: false }],
"vEthernet (Default Switch)": [{ address: "172.25.80.1", family: "IPv4", internal: false }],
"vEthernet (WSL (Hyper-V firewall))": [
{ address: "172.24.144.1", family: "IPv4", internal: false },
],
"Wi-Fi": [{ address: "192.168.1.147", family: "IPv4", internal: false }],
},
Effect.gen(function* () {
const serverExposure = yield* DesktopServerExposure.DesktopServerExposure;
yield* serverExposure.configureFromSettings({ port: 4173 });

const change = yield* serverExposure.setMode("network-accessible");
assert.equal(change.state.advertisedHost, "192.168.1.147");
}),
),
);

it.effect("persists tailscale serve preferences atomically and reports no-op updates", () =>
withHarness(
emptyNetworkInterfaces,
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/backend/DesktopServerExposure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const isUsableLanIpv4Address = (address: string): boolean =>

// Private bridges and VM adapters are fallbacks; host bridges can carry the real LAN address.
const HOST_ONLY_INTERFACE =
/^(bridge\d|utun|ipsec|ppp|tun|tap|wg|docker|br-|veth|virbr|vmnet|vboxnet|VirtualBox|VMware)/;
/^(bridge\d|utun|ipsec|ppp|tun|tap|wg|docker|br-|veth|virbr|vmnet|vboxnet|VirtualBox|VMware|vEthernet)/;

const isHttpsEndpointUrl = (value: string): boolean => {
try {
Expand Down
Loading