diff --git a/core/modules/server/server.js b/core/modules/server/server.js index eea7a5dbd..258ddfa31 100644 --- a/core/modules/server/server.js +++ b/core/modules/server/server.js @@ -359,8 +359,9 @@ Server.prototype.listen = function(port,host,prefix) { } // Display the port number after we've started listening (the port number might have been specified as zero, in which case we will get an assigned port) server.on("listening",function() { - var address = server.address(); - $tw.utils.log("Serving on " + self.protocol + "://" + address.address + ":" + address.port + prefix,"brown/orange"); + var address = server.address(), + url = self.protocol + "://" + (address.family === "IPv6" ? "[" + address.address + "]" : address.address) + ":" + address.port + prefix; + $tw.utils.log("Serving on " + url,"brown/orange"); $tw.utils.log("(press ctrl-C to exit)","red"); }); // Listen