Skip to content

Commit

Permalink
fix(cli-framework/network): change localhost 0.0.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rdlabo committed Jul 31, 2018
1 parent 65d79ca commit a8f59f9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/@ionic/cli-framework/src/utils/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ export async function isPortAvailable(port: number, host?: string): Promise<bool
export async function isHostConnectable(host: string, port: number, { timeout }: { timeout?: number; } = {}): Promise<boolean> {
const tryConnect = async () => {
return new Promise<boolean>((resolve, reject) => {
if (host === 'localhost') {
host = '0.0.0.0';
}
const sock = net.connect({ port, host });

sock.on('connect', () => {
Expand Down

0 comments on commit a8f59f9

Please sign in to comment.