From 98f250cfc4f415a95abd97bbf45776c3234639c2 Mon Sep 17 00:00:00 2001 From: Alexis Deruelle Date: Sat, 2 May 2020 15:02:51 +0200 Subject: [PATCH] Fix port availability test Problem raised on macOS where port 49152 was used by rapportd process listening on 0.0.0.0 address and as a consequence the application proxy server wasn't correctly setup that in turn disrupted the webview display that wasn't served through http://.localhost:49152/ (#255) Indeed the checkPort() function was checking port availability using the 127.0.0.1 address that doesn't error. The minimal fix here is to test port availability using 0.0.0.0 address. Signed-off-by: Alexis Deruelle --- src/main/port.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/port.ts b/src/main/port.ts index 6240575ee1..d4ca906ae3 100644 --- a/src/main/port.ts +++ b/src/main/port.ts @@ -9,7 +9,7 @@ function checkPort(port: number) { server .on('error', error => reject(error)) .on('listening', () => server.close(() => resolve(port))) - .listen({host: "127.0.0.1", port: port})) + .listen({host: "0.0.0.0", port: port})) } export async function getFreePort(firstPort: number, lastPort: number): Promise {