diff options
author | Tom Smeding <tom@tomsmeding.com> | 2022-08-22 21:21:53 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2022-08-22 21:21:53 +0200 |
commit | a3bdfe58867d57b39cf139fe7134c020fc9dcb44 (patch) | |
tree | b7607135bcf0c873a7ffe89a0bee8dffe069b878 /server.js | |
parent | d1c02019db9a6fb2ab053091c9a4a32dc00b8b50 (diff) |
Reformatting, print 'localhost' instead of :::
Diffstat (limited to 'server.js')
-rwxr-xr-x | server.js | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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); }); |