Skip to content

Commit

Permalink
fix: confirm external ip (#2895)
Browse files Browse the repository at this point in the history
Confirm the public ip, not the private one
  • Loading branch information
achingbrain authored Dec 13, 2024
1 parent a08229b commit 52f0f2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/upnp-nat/src/upnp-port-mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class UPnPPortMapper {
this.log('created mapping of %s:%s to %s:%s for protocol %s', mapping.internalHost, mapping.internalPort, mapping.externalHost, mapping.externalPort, transport)

if (options?.autoConfirmAddress === true) {
const ma = multiaddr(`/ip${family}/${host}/${transport}/${port}`)
const ma = multiaddr(`/ip${isIPv4(mapping.externalHost) ? 4 : 6}/${mapping.externalHost}/${transport}/${mapping.externalPort}`)
this.log('auto-confirming IP address %a', ma)
this.addressManager.confirmObservedAddr(ma, {
ttl: MAX_DATE - Date.now()
Expand Down

0 comments on commit 52f0f2f

Please sign in to comment.