You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm getting this error trying to use the PMP client.
import { upnpNat, pmpNat } from '@achingbrain/nat-port-mapper'
async function main() {
// const client = await upnpNat({
const client = await pmpNat({
// all fields are optional
ttl: 20*60, // how long mappings should live for in seconds - min 20 minutes, default 2 hours
description: 'hello', // default description to pass to the router for a mapped port
gateway: '10.2.0.1', // override the router address, will be auto-detected if not set
keepAlive: true // if true, refresh the mapping ten minutes before the ttl is reached, default true
})
// Map public port 1000 to private port 1000 with TCP
await client.map({
localPort: 1000,
protocol: 'TCP'
})
// Get external IP
const externalIp = await client.externalIp()
console.log('External IP:', externalIp)
// Unmap all mapped ports
client.close()
}
main()
Here's the error:
> $ node index.mjs ⬡ 18.18.2
External IP: {
msg: <Buffer 00 80 00 00 00 07 5c 98 59 2d 04 0c>,
vers: 0,
op: 128,
resultCode: 0,
resultMessage: 'Success',
epoch: 482456,
ip: [ 89, 45, 4, 12 ]
}
node:internal/errors:496
ErrorCaptureStackTrace(err);
^
Error [ERR_SOCKET_DGRAM_NOT_RUNNING]: Not running
at new NodeError (node:internal/errors:405:5)
at healthCheck (node:dgram:920:11)
at Socket.bind (node:dgram:240:3)
at PMPClient.connect (file:///home/michael/temp/node_modules/@achingbrain/nat-port-mapper/dist/src/pmp/index.js:62:21)
at PMPClient._next (file:///home/michael/temp/node_modules/@achingbrain/nat-port-mapper/dist/src/pmp/index.js:201:22)
at PMPClient.request (file:///home/michael/temp/node_modules/@achingbrain/nat-port-mapper/dist/src/pmp/index.js:182:14)
at PMPClient.map (file:///home/michael/temp/node_modules/@achingbrain/nat-port-mapper/dist/src/pmp/index.js:83:14)
at async PMPClient.unmap (file:///home/michael/temp/node_modules/@achingbrain/nat-port-mapper/dist/src/pmp/index.js:88:9)
at async NatAPI.unmap (file:///home/michael/temp/node_modules/@achingbrain/nat-port-mapper/dist/src/index.js:57:9) {
code: 'ERR_SOCKET_DGRAM_NOT_RUNNING'
}
Node.js v18.18.2
Could you submit a PR with a fix? PMP seems to be broken on my router after an update, it's enabled in config but the ports are closed so I can only use UPnP at the moment.
Hi, I'm getting this error trying to use the PMP client.
Here's the error:
It appears the client is attempting to bind to a closed socket. https://stackoverflow.com/a/56016615/1483977
The text was updated successfully, but these errors were encountered: