diff --git a/lib/node.js b/lib/node.js index 68c1c35..066bf1f 100644 --- a/lib/node.js +++ b/lib/node.js @@ -44,7 +44,7 @@ class Node extends EventEmitter { for(let port = config.ports.relay; port <= config.ports.relayEnd; port ++) { if(takenPorts.indexOf(port) === -1) { console.log('registering to port ' + port); - await upnp.mapIndefinite(port, 10, this.name); + await upnp.mapIndefinite(port, this.name); break; } else { console.log('port ' + port + ' is taken...'); diff --git a/lib/upnp.js b/lib/upnp.js index ca466f8..918af49 100644 --- a/lib/upnp.js +++ b/lib/upnp.js @@ -15,7 +15,7 @@ module.exports.map = function(port, ttl = 10, name = 'upnp application') { }); }; -module.exports.mapIndefinite = function(port, name) { +module.exports.mapIndefinite = function(port, name = 'upnp application') { return new Promise((res, rej) => { client.portMapping({ private: port,