Merge pull request #157 from tschaub/address
Enclose literal IPv6 addresses in brackets
This commit is contained in:
commit
27e9dbfb4e
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