Skip to content

Commit 27059e7

Browse files
RicardoVarandafilipesilva
authored andcommitted
fix(@angular/cli): open option in serve command should open localhost when host is 0.0.0.0
Close #5743
1 parent c6a8fcb commit 27059e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/@angular/cli/tasks/serve.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default Task.extend({
4444

4545
const serverAddress = url.format({
4646
protocol: serveTaskOptions.ssl ? 'https' : 'http',
47-
hostname: serveTaskOptions.host,
47+
hostname: serveTaskOptions.host === '0.0.0.0' ? 'localhost' : serveTaskOptions.host,
4848
port: serveTaskOptions.port.toString()
4949
});
5050
let clientAddress = serverAddress;
@@ -179,7 +179,7 @@ export default Task.extend({
179179

180180
ui.writeLine(chalk.green(oneLine`
181181
**
182-
NG Live Development Server is running on ${serverAddress}
182+
NG Live Development Server is listening on ${serveTaskOptions.host}:${serveTaskOptions.port}, open your browser on ${serverAddress}
183183
**
184184
`));
185185

0 commit comments

Comments
 (0)