Skip to content

Commit d1f0c70

Browse files
authored
fix: send healtchecks to 127.0.0.1 instead of localhost (#30)
Connecting to `localhost` can have some connection issues in certain scenarios.
1 parent 5e2cb57 commit d1f0c70

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/manage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ async function fetchHealth(): Promise<boolean> {
1717
// for example, if localstack becomes unhealthy while running for reasons other that stop then reporting "stopping" may be misleading.
1818
// though we don't know if it happens often.
1919
try {
20-
const response = await fetch("http://localhost:4566/_localstack/health");
20+
const response = await fetch("http://127.0.0.1:4566/_localstack/health");
2121
return response.ok;
2222
} catch {
2323
return false;
@@ -28,7 +28,7 @@ async function fetchLocalStackSessionId(): Promise<string> {
2828
try {
2929
// TODO info endpoint is not available immediately
3030
// potentially improve this later for tracking "vscode:emulator:started"
31-
const infoResponse = await fetch("http://localhost:4566/_localstack/info");
31+
const infoResponse = await fetch("http://127.0.0.1:4566/_localstack/info");
3232
if (infoResponse.ok) {
3333
const info = (await infoResponse.json()) as { session_id?: string };
3434
return info.session_id ?? "";

0 commit comments

Comments
 (0)