From a3bdfe58867d57b39cf139fe7134c020fc9dcb44 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Mon, 22 Aug 2022 21:21:53 +0200 Subject: Reformatting, print 'localhost' instead of ::: --- server.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'server.js') diff --git a/server.js b/server.js index 21d9094..791a227 100755 --- a/server.js +++ b/server.js @@ -174,7 +174,8 @@ io.on("connection", socket => { // ------------------------------ const server = httpServer.listen(PORT, () => { - const host = server.address().address; - const port = server.address().port; - console.log("Server listening at http://" + host + ":" + port); + let host = server.address().address; + if (host == "::") host = "localhost"; + const port = server.address().port; + console.log("Server listening at http://" + host + ":" + port); }); -- cgit v1.2.3-70-g09d2