From c4b9d9360a0aeb58d940b2c7b316b05588cd3511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Pallar=C3=A9s?= Date: Fri, 5 Sep 2025 12:21:07 +0200 Subject: [PATCH] fix: send healtchecks to 127.0.0.1 instead of localhost Connecting to `localhost` can have some connection issues in certain scenarios. --- src/utils/manage.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/manage.ts b/src/utils/manage.ts index fb8cf1b..c650bd4 100644 --- a/src/utils/manage.ts +++ b/src/utils/manage.ts @@ -17,7 +17,7 @@ async function fetchHealth(): Promise { // for example, if localstack becomes unhealthy while running for reasons other that stop then reporting "stopping" may be misleading. // though we don't know if it happens often. try { - const response = await fetch("http://localhost:4566/_localstack/health"); + const response = await fetch("http://127.0.0.1:4566/_localstack/health"); return response.ok; } catch { return false; @@ -28,7 +28,7 @@ async function fetchLocalStackSessionId(): Promise { try { // TODO info endpoint is not available immediately // potentially improve this later for tracking "vscode:emulator:started" - const infoResponse = await fetch("http://localhost:4566/_localstack/info"); + const infoResponse = await fetch("http://127.0.0.1:4566/_localstack/info"); if (infoResponse.ok) { const info = (await infoResponse.json()) as { session_id?: string }; return info.session_id ?? "";