Skip to content

Commit

Permalink
fix condition check
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Sep 14, 2023
1 parent 07915f0 commit fd57374
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/listen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,13 @@ export async function listen(
const _localhost = isLocalhost(listhenOptions.hostname);
const _anyhost = isAnyhost(listhenOptions.hostname);
if (listhenOptions.public && _localhost) {
if (!isWsl() && !isDocker()) {
consola.warn(
`[listhen] Trying to listhen on private host ${JSON.stringify(
listhenOptions.hostname,
)} with public option disabled.`,
);
listhenOptions.public = false;
}
} else if (!listhenOptions.public && _anyhost) {
consola.warn(
`[listhen] Trying to listhen on private host ${JSON.stringify(
listhenOptions.hostname,
)} with public option disabled.`,
);
listhenOptions.public = false;
} else if (!listhenOptions.public && _anyhost && !(isWsl() || isDocker())) {
consola.warn(
`[listhen] Trying to listhen on public host ${JSON.stringify(
listhenOptions.hostname,
Expand Down

0 comments on commit fd57374

Please sign in to comment.