The AutoNAT service implements the AutoNAT protocol to confirm whether addresses the node is listening on are dialable by remote peers.
It does not implement NAT hole punching.
AutoNat v2 is now available and should be preferred to this module.
import { createLibp2p } from 'libp2p'import { autoNAT } from '@libp2p/autonat'const node = await createLibp2p({ // ...other options services: { autoNAT: autoNAT() }}) Copy
import { createLibp2p } from 'libp2p'import { autoNAT } from '@libp2p/autonat'const node = await createLibp2p({ // ...other options services: { autoNAT: autoNAT() }})
The AutoNAT service implements the AutoNAT protocol to confirm whether addresses the node is listening on are dialable by remote peers.
It does not implement NAT hole punching.
AutoNat v2 is now available and should be preferred to this module.
Example