From db41f106bc589b3016ab0889e5d5ec82c3d4950f Mon Sep 17 00:00:00 2001 From: Asher Date: Tue, 16 Jul 2019 19:23:58 -0500 Subject: [PATCH] Fix open flag when using 0.0.0.0 --- src/cli.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index 05c3dd8b..1bf52df6 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -193,9 +193,11 @@ const main = async (): Promise => { console.log(" - Not serving HTTPS"); } - if (args["open"]) { - await open(serverAddress).catch(console.error); - console.log(` - Opened ${serverAddress}`); + if (!args.socket && args.open) { + // The web socket doesn't seem to work if using 0.0.0.0. + const openAddress = `http://localhost:${port}`; + await open(openAddress).catch(console.error); + console.log(` - Opened ${openAddress}`); } };