From b491fa97ac5422c5361a3e159af1aa7f321bbfe7 Mon Sep 17 00:00:00 2001 From: ckcks12 Date: Mon, 3 Sep 2018 16:30:29 +0900 Subject: [PATCH] fix confusing hostname Even if it's on public(like `0.0.0.0` or '::`) hostname is still `localhost` so it may confuses developers. --- lib/server.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/server.js b/lib/server.js index b4c361e..4a262a3 100644 --- a/lib/server.js +++ b/lib/server.js @@ -86,6 +86,8 @@ function checkPort(ip, port) { function formatAddress(ip, port, root) { var hostname = ip; if (ip === '0.0.0.0' || ip === '::') { + hostname = ''; + } else if (ip === 'localhost' || ip === '127.0.0.1') { hostname = 'localhost'; }