The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 12:15 UTC
fix(server): an explicit Tailscale IPv6 bind is advertised as a tailnet route (#34742)
Julius Marminge committed
Nov 14, 2026 at 20:50 UTC
8bc7a08227489288f059c8d3a8a0939722c39f05
2 files changed
+16
-1
apps/server/src/environment/DirectEndpoints.test.ts
+11
@@ -246,6 +246,17 @@ describe("resolveBoundEndpoints", () => {
246
).toEqual([{ kind: "tailnet", httpBaseUrl: "http://100.101.102.103:3773/" }]);
247
});
248
249
+ it("reports an explicit bind to Tailscale's IPv6 address as the tailnet route", () => {
250
+ expect(
251
+ resolveBoundEndpoints({
252
+ platform: "linux",
253
+ host: "fd7a:115c:a1e0::1",
254
+ port: 3773,
255
+ interfaces: INTERFACES,
256
+ }),
257
+ ).toEqual([{ kind: "tailnet", httpBaseUrl: "http://[fd7a:115c:a1e0::1]:3773/" }]);
258
+ });
259
+
260
it("never reports an IPv4-mapped host, which can name the client's own loopback", () => {
261
expect(
262
resolveBoundEndpoints({
apps/server/src/environment/DirectEndpoints.ts
+5
-1
@@ -40,6 +40,7 @@ export class DirectEndpoints extends Context.Service<
40
>()("t3/environment/DirectEndpoints") {}
41
42
// Credentials travel over HTTP; public IPs leak them and hostnames can resolve differently per client.
43
+// Wildcard binds stay IPv4: the private-network listener check accepts only IPv4 peers.
44
const isAdvertisableAddress = (address: string): boolean =>
45
NodeNet.isIPv4(address) && !address.startsWith("127.") && isPrivateNetworkAddress(address);
46
@@ -81,7 +82,10 @@ export function resolveBoundEndpoints(input: {
82
!(input.platform === "win32" && WINDOWS_HOST_ADAPTER_MAC.test(entry.mac)),
83
)
84
.map((entry) => entry.address)
84
- : [input.host!].filter(isAdvertisableAddress);
85
+ : [input.host!].filter(
86
+ (address) =>
87
+ isAdvertisableAddress(address) || (NodeNet.isIPv6(address) && isTailnetHost(address)),
88
+ );
89
return [...new Set(addresses)]
90
.filter((address) => !input.onCloudVm || tailscaleAddresses.has(address))
91
.map((address) => ({