Skip to content

Commit ef9b00b

Browse files
committed
Fix open flag when using 0.0.0.0
1 parent 676fa46 commit ef9b00b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/cli.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,11 @@ const main = async (): Promise<void> => {
193193
console.log(" - Not serving HTTPS");
194194
}
195195

196-
if (args["open"]) {
197-
await open(serverAddress).catch(console.error);
198-
console.log(` - Opened ${serverAddress}`);
196+
if (!args.socket && args.open) {
197+
// The web socket doesn't seem to work if using 0.0.0.0.
198+
const openAddress = `http://localhost:${port}`;
199+
await open(openAddress).catch(console.error);
200+
console.log(` - Opened ${openAddress}`);
199201
}
200202
};
201203

0 commit comments

Comments
 (0)