-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
bugSomething isn't workingSomething isn't working
Description
nat-api version: 0.1.2
c:\>systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.18363 N/A Build 18363
c:\>node --version
v12.13.1
const NatAPI = require('nat-api');
const client = new NatAPI({autoUpdate: false});
Test 1:
client.map(10000,function (err) {
if (err) return console.log('Error', err);
console.log('Port mapped!');
});
Maps port 10000 UDP and bombs for TCP with:
dgram.js:839
throw new ERR_SOCKET_DGRAM_NOT_RUNNING();
^
Error [ERR_SOCKET_DGRAM_NOT_RUNNING]: Not running
at healthCheck (dgram.js:839:11)
at Socket.send (dgram.js:609:3)
at Client._next (C:\Users\Cos\Desktop\test\node-upnp-test\node_modules\nat-pmp\index.js:230:15)
at Client.request (C:\Users\Cos\Desktop\test\node-upnp-test\node_modules\nat-pmp\index.js:155:8)
at Client.portMapping (C:\Users\Cos\Desktop\test\node-upnp-test\node_modules\nat-pmp\index.js:182:8)
at NatAPI._pmpMap (C:\Users\Cos\Desktop\test\node-upnp-test\node_modules\nat-api\index.js:316:21)
at NatAPI._map (C:\Users\Cos\Desktop\test\node-upnp-test\node_modules\nat-api\index.js:229:12)
at C:\Users\Cos\Desktop\test\node-upnp-test\node_modules\nat-api\index.js:78:14
at C:\Users\Cos\Desktop\test\node-upnp-test\node_modules\nat-api\index.js:233:9
at Client.<anonymous> (C:\Users\Cos\Desktop\test\node-upnp-test\node_modules\nat-api\index.js:342:7) {
code: 'ERR_SOCKET_DGRAM_NOT_RUNNING'
}
Test 2 (with NULL protocol in options):
client.map({ publicPort: 10000, privatePort: 10000, ttl: 1200 , protocol: null},function (err) {
if (err) return console.log('Error', err);
console.log('Port mapped!');
});
Maps port 10000 UDP and bombs for TCP with:
dgram.js:839
throw new ERR_SOCKET_DGRAM_NOT_RUNNING();
^
Error [ERR_SOCKET_DGRAM_NOT_RUNNING]: Not running
at healthCheck (dgram.js:839:11)
at Socket.send (dgram.js:609:3)
at Client._next (C:\Users\Cos\Desktop\test\node-upnp-test\node_modules\nat-pmp\index.js:230:15)
at Client.request (C:\Users\Cos\Desktop\test\node-upnp-test\node_modules\nat-pmp\index.js:155:8)
at Client.portMapping (C:\Users\Cos\Desktop\test\node-upnp-test\node_modules\nat-pmp\index.js:182:8)
at NatAPI._pmpMap (C:\Users\Cos\Desktop\test\node-upnp-test\node_modules\nat-api\index.js:316:21)
at NatAPI._map (C:\Users\Cos\Desktop\test\node-upnp-test\node_modules\nat-api\index.js:229:12)
at C:\Users\Cos\Desktop\test\node-upnp-test\node_modules\nat-api\index.js:78:14
at C:\Users\Cos\Desktop\test\node-upnp-test\node_modules\nat-api\index.js:233:9
at Client.<anonymous> (C:\Users\Cos\Desktop\test\node-upnp-test\node_modules\nat-api\index.js:342:7) {
code: 'ERR_SOCKET_DGRAM_NOT_RUNNING'
}
Test 3:
client.map({ publicPort: 10000, privatePort: 10000, ttl: 1200 , protocol: 'TCP'},function (err) {
if (err) return console.log('Error', err);
console.log('Port mapped!');
});
Works: Port mapped!
Test 4:
client.map({ publicPort: 10000, privatePort: 10000, ttl: 1200 , protocol: 'UDP'},function (err) {
if (err) return console.log('Error', err);
console.log('Port mapped!');
});
Works: Port mapped!
Test 5:
client.map({ publicPort: 10000, privatePort: 10000, ttl: 1200 , protocol: 'TCP'},function (err) {
if (err) return console.log('Error', err);
console.log('Port mapped!');
});
client.map({ publicPort: 10000, privatePort: 10000, ttl: 1200 , protocol: 'UDP'},function (err) {
if (err) return console.log('Error', err);
console.log('Port mapped!');
});
TCP port mapped, UDP port bombs:
Port mapped!
dgram.js:839
throw new ERR_SOCKET_DGRAM_NOT_RUNNING();
^
Error [ERR_SOCKET_DGRAM_NOT_RUNNING]: Not running
at healthCheck (dgram.js:839:11)
at Socket.send (dgram.js:609:3)
at Client._next (C:\Users\Cos\Desktop\test\node-upnp-test\node_modules\nat-pmp\index.js:230:15)
at cb (C:\Users\Cos\Desktop\test\node-upnp-test\node_modules\nat-pmp\index.js:284:10)
at Client.onmessage (C:\Users\Cos\Desktop\test\node-upnp-test\node_modules\nat-pmp\index.js:335:5)
at Socket.<anonymous> (C:\Users\Cos\Desktop\test\node-upnp-test\node_modules\nat-pmp\index.js:371:32)
at Socket.emit (events.js:210:5)
at UDP.onMessage [as onmessage] (dgram.js:861:8) {
code: 'ERR_SOCKET_DGRAM_NOT_RUNNING'
}
Test 6:
client.map({ publicPort: 10000, privatePort: 10000, ttl: 1200 , protocol: 'UDP'},function (err) {
if (err) return console.log('Error', err);
console.log('Port mapped!');
});
client.map({ publicPort: 10000, privatePort: 10000, ttl: 1200 , protocol: 'TCP'},function (err) {
if (err) return console.log('Error', err);
console.log('Port mapped!');
});
UDP port maps, TCP port bombs:
Port mapped!
dgram.js:839
throw new ERR_SOCKET_DGRAM_NOT_RUNNING();
^
Error [ERR_SOCKET_DGRAM_NOT_RUNNING]: Not running
at healthCheck (dgram.js:839:11)
at Socket.send (dgram.js:609:3)
at Client._next (C:\Users\Cos\Desktop\test\node-upnp-test\node_modules\nat-pmp\index.js:230:15)
at cb (C:\Users\Cos\Desktop\test\node-upnp-test\node_modules\nat-pmp\index.js:284:10)
at Client.onmessage (C:\Users\Cos\Desktop\test\node-upnp-test\node_modules\nat-pmp\index.js:335:5)
at Socket.<anonymous> (C:\Users\Cos\Desktop\test\node-upnp-test\node_modules\nat-pmp\index.js:371:32)
at Socket.emit (events.js:210:5)
at UDP.onMessage [as onmessage] (dgram.js:861:8) {
code: 'ERR_SOCKET_DGRAM_NOT_RUNNING'
}
Conclusion: dual TCP/UDP port mapping does not work as expected.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working