Fix open flag when using 0.0.0.0

This commit is contained in:
Asher 2019-07-16 19:23:58 -05:00
parent b6fdb7d0e7
commit db41f106bc
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A
1 changed files with 5 additions and 3 deletions

View File

@ -193,9 +193,11 @@ const main = async (): Promise<void> => {
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}`);
}
};