upnp: better params for addPortMapping.
This commit is contained in:
parent
0791bad973
commit
36377d5a7f
@ -505,11 +505,12 @@ UPNPService.prototype.getExternalIP = co(function* () {
|
||||
/**
|
||||
* Attempt to add port mapping to local IP.
|
||||
* @param {String} remote - Remote IP.
|
||||
* @param {Number} port - Local and remote port.
|
||||
* @param {Number} src - Remote port.
|
||||
* @param {Number} dest - Local port.
|
||||
* @returns {Promise}
|
||||
*/
|
||||
|
||||
UPNPService.prototype.addPortMapping = co(function* (remote, port) {
|
||||
UPNPService.prototype.addPortMapping = co(function* (remote, src, dest) {
|
||||
var action = 'AddPortMapping';
|
||||
var local = UPNP.getLocalIP();
|
||||
var xml, child;
|
||||
@ -519,10 +520,10 @@ UPNPService.prototype.addPortMapping = co(function* (remote, port) {
|
||||
|
||||
xml = yield this.soapRequest(action, [
|
||||
['NewRemoteHost', remote],
|
||||
['NewExternalPort', port],
|
||||
['NewExternalPort', src],
|
||||
['NewProtocol', 'TCP'],
|
||||
['NewInternalClient', local],
|
||||
['NewInternalPort', port],
|
||||
['NewInternalPort', dest],
|
||||
['NewEnabled', 'True'],
|
||||
['NewPortMappingDescription', 'upnp:bcoin'],
|
||||
['NewLeaseDuration', 0]
|
||||
@ -539,7 +540,7 @@ UPNPService.prototype.addPortMapping = co(function* (remote, port) {
|
||||
/**
|
||||
* Attempt to remove port mapping from local IP.
|
||||
* @param {String} remote - Remote IP.
|
||||
* @param {Number} port - Local and remote port.
|
||||
* @param {Number} port - Remote port.
|
||||
* @returns {Promise}
|
||||
*/
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user