Skip to content

Commit a8f59f9

Browse files
committed
fix(cli-framework/network): change localhost 0.0.0.0
1 parent 65d79ca commit a8f59f9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/@ionic/cli-framework/src/utils/network.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ export async function isPortAvailable(port: number, host?: string): Promise<bool
7777
export async function isHostConnectable(host: string, port: number, { timeout }: { timeout?: number; } = {}): Promise<boolean> {
7878
const tryConnect = async () => {
7979
return new Promise<boolean>((resolve, reject) => {
80+
if (host === 'localhost') {
81+
host = '0.0.0.0';
82+
}
8083
const sock = net.connect({ port, host });
8184

8285
sock.on('connect', () => {

0 commit comments

Comments
 (0)