aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/app.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/app.js b/lib/app.js
index 5b3035a..8b6d897 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -76,11 +76,11 @@ App.prototype.go = function () {
var server = http.createServer(function (req, res) {
new Serve(self, req, res).go()
})
- if (self.host === 'localhost') server.listen(self.port, onListening)
- else server.listen(self.port, self.host, onListening)
+ server.listen(self.port, self.host, onListening)
function onListening() {
- var host = /:/.test(self.host) ? '[' + self.host + ']' : self.host
- self.log('Listening on http://' + host + ':' + self.port)
+ var addr = server.address()
+ var host = addr.family === 'IPv6' ? '[' + addr.address + ']' : addr.address
+ self.log('Listening on http://' + host + ':' + addr.port)
}
// invalidate cached About info when new About messages come in