Merge pull request #2667 from LaurenceJJones/feature/newt-ipv6-format-endpoint

fix(newt): Format ipv6 targets for go
This commit is contained in:
Owen Schwartz
2026-03-18 15:34:36 -07:00
committed by GitHub

View File

@@ -14,7 +14,11 @@ import logger from "@server/logger";
import { initPeerAddHandshake, updatePeer } from "../olm/peers"; import { initPeerAddHandshake, updatePeer } from "../olm/peers";
import { eq, and } from "drizzle-orm"; import { eq, and } from "drizzle-orm";
import config from "@server/lib/config"; import config from "@server/lib/config";
import { generateSubnetProxyTargets, SubnetProxyTarget } from "@server/lib/ip"; import {
formatEndpoint,
generateSubnetProxyTargets,
SubnetProxyTarget
} from "@server/lib/ip";
export async function buildClientConfigurationForNewtClient( export async function buildClientConfigurationForNewtClient(
site: Site, site: Site,
@@ -219,8 +223,8 @@ export async function buildTargetConfigurationForNewtClient(siteId: number) {
return acc; return acc;
} }
// Format target into string // Format target into string (handles IPv6 bracketing)
const formattedTarget = `${target.internalPort}:${target.ip}:${target.port}`; const formattedTarget = `${target.internalPort}:${formatEndpoint(target.ip, target.port)}`;
// Add to the appropriate protocol array // Add to the appropriate protocol array
if (target.protocol === "tcp") { if (target.protocol === "tcp") {