From 42442e007eaed4a7a33590fb7b6f166f40392443 Mon Sep 17 00:00:00 2001 From: suraj-markup Date: Sun, 1 Mar 2026 21:53:11 +0530 Subject: [PATCH] fix(cli): correct misleading comment on isPortAvailable IPv6 coverage The comment claimed connect-based detection works for IPv6 listeners, but the probe only connects to 127.0.0.1 (IPv4). Updated the comment to accurately document this limitation. Co-Authored-By: Claude Opus 4.6 --- packages/cli/src/lib/web-dir.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/lib/web-dir.ts b/packages/cli/src/lib/web-dir.ts index ac911132e..2af2a77ce 100644 --- a/packages/cli/src/lib/web-dir.ts +++ b/packages/cli/src/lib/web-dir.ts @@ -17,13 +17,13 @@ const require = createRequire(import.meta.url); const DEFAULT_TERMINAL_PORT = 14800; /** - * Check if a TCP port is available by attempting to connect to it. + * Check if a TCP port is available by attempting to connect to it on IPv4. * A successful connect means something is already listening (port in use). * ECONNREFUSED means nothing is listening (port free). * - * Connect-based detection is more reliable than bind-based because it works - * regardless of whether the occupying process is bound to 127.0.0.1, ::1, - * 0.0.0.0, or :: (IPv6 wildcard). + * Note: Only probes 127.0.0.1 (IPv4). Processes listening exclusively on + * IPv6 (::1 with IPV6_V6ONLY=1) will not be detected — this is acceptable + * since the dashboard binds to 0.0.0.0 by default. */ export function isPortAvailable(port: number): Promise { return new Promise((resolve) => {