Express.js-为什么是Localhost'::'

任何人都可以告诉我为什么我的服务器地址(主机)是::而不是本地主机

var express = require('express'); var app = express(); // respond with "hello world" when a GET request is made to the homepage app.get('/', function(req, res) { res.send('hello world'); }); var server = app.listen(3000, function () { var host = server.address().address; var port = server.address().port; console.log('Example app listening at http://%s:%s', host, port); }); 

这返回

 Example app listening at http://:::3000 

当我去http:// localhost:3000 /

因为::是使用IPv6的本地主机,就像它在IPv4中是127.0.0.1一样。