Skip to content

Commit b491fa9

Browse files
authored
fix confusing hostname
Even if it's on public(like `0.0.0.0` or '::`) hostname is still `localhost` so it may confuses developers.
1 parent 6abc675 commit b491fa9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/server.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ function checkPort(ip, port) {
8686
function formatAddress(ip, port, root) {
8787
var hostname = ip;
8888
if (ip === '0.0.0.0' || ip === '::') {
89+
hostname = '';
90+
} else if (ip === 'localhost' || ip === '127.0.0.1') {
8991
hostname = 'localhost';
9092
}
9193

0 commit comments

Comments
 (0)