Enclose literal IPv6 addresses in brackets
This commit is contained in:
parent
c03b0a12f8
commit
a199008fa3
1 changed files with 5 additions and 2 deletions
|
@ -355,8 +355,11 @@ module.exports = function(opts) {
|
||||||
});
|
});
|
||||||
|
|
||||||
var server = app.listen(process.env.PORT || opts.port, process.env.BIND || opts.bind, function() {
|
var server = app.listen(process.env.PORT || opts.port, process.env.BIND || opts.bind, function() {
|
||||||
console.log('Listening at http://%s:%d/',
|
var address = this.address().address;
|
||||||
this.address().address, this.address().port);
|
if (address.indexOf('::') === 0) {
|
||||||
|
address = '[' + address + ']'; // literal IPv6 address
|
||||||
|
}
|
||||||
|
console.log('Listening at http://%s:%d/', address, this.address().port);
|
||||||
});
|
});
|
||||||
|
|
||||||
process.on('SIGINT', function() {
|
process.on('SIGINT', function() {
|
||||||
|
|
Loading…
Reference in a new issue