From d3d715998801dabf0b8984128c852c7bbab53b56 Mon Sep 17 00:00:00 2001 From: Gurkan Date: Tue, 24 Oct 2023 17:27:16 +0200 Subject: [PATCH] add hostname.local for wsl --- bin/index.mts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/index.mts b/bin/index.mts index 2581ef27d..79e1b78b5 100755 --- a/bin/index.mts +++ b/bin/index.mts @@ -24,6 +24,7 @@ import { logBuildPlugin } from "../src/util.mjs"; import { sassPlugin } from "esbuild-sass-plugin"; import { fileURLToPath } from "url"; import { AddonType, getAddonFolder, isMonoRepo, selectAddon } from "./mono.mjs"; +import { hostname } from "os"; interface BaseArgs { watch?: boolean; @@ -70,7 +71,7 @@ let connectingPromise: Promise | undefined; * Try to connect to RPC on a specific port and handle the READY event as well as errors and close events */ function tryPort(port: number): Promise { - ws = new WebSocket(`ws://127.0.0.1:${port}/?v=1&client_id=REPLUGGED-${random()}`); + ws = new WebSocket(`ws://${hostname()}.local:${port}/?v=1&client_id=REPLUGGED-${random()}`); return new Promise((resolve, reject) => { let didFinish = false; ws?.on("message", (data) => {