Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop,web): advertise all usable network interfaces as selectable endpoints #5165

ClosedWilliam-BnCRocks(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/5165/headopened View on GitHub

Showing 7 changed files with 166 additions and 0 deletions (loading 5).

x
0 of 7 viewed, 7 left
7 additions and 0 deletionsapps/desktop/src/backend/DesktopNetworkInterfaces.tsModified
View file
@@ -20,6 +20,13 @@
Record<string, readonly DesktopNetworkInterfaceInfo[] | undefined>
>;
​
+// Some Node builds report the address family as the number 4/6 instead of
+// "IPv4"/"IPv6" (see DesktopBackendConfiguration.isLocalHostIpv4).
+export const isIpv4Family = (family: string | number): boolean => {
+ const normalized = String(family);
+ return normalized === "IPv4" || normalized === "4";
+};
+​
export class DesktopNetworkInterfacesReadError extends Schema.TaggedErrorClass<DesktopNetworkInterfacesReadError>()(
"DesktopNetworkInterfacesReadError",
159 additions and 0 deletionsapps/desktop/src/backend/DesktopServerExposure.test.tsModified
View file
@@ -38,6 +38,16 @@
],
};
​
+const multiNicNetworkInterfaces: DesktopNetworkInterfaces.NetworkInterfaces = {
+ wg0: [{ address: "10.8.0.5", family: "IPv4", internal: false }],
+ en0: [
+ { address: "192.168.1.20", family: "IPv4", internal: false },
+ { address: "fe80::1", family: "IPv6", internal: false },
+ ],
+ en1: [{ address: "169.254.10.10", family: "IPv4", internal: false }],
+ lo0: [{ address: "127.0.0.1", family: "IPv4", internal: true }],