@libp2p/upnp-nat
v3.0.3
Published
UPnP NAT hole punching
Downloads
30,089
Keywords
Readme
@libp2p/upnp-nat
UPnP NAT hole punching
About
The service exported by this module attempts to configure NAT hole punching via UPnP.
This will make your node publicly accessible from the internet.
For this to work there are some prerequisites:
- Your router must have UPnP support enabled
- Your libp2p node must be listening on a non-loopback IPv4 address
- You must not be double-NATed by your ISP
Example
import { createLibp2p } from 'libp2p'
import { tcp } from '@libp2p/tcp'
import { uPnPNAT } from '@libp2p/upnp-nat'
const node = await createLibp2p({
addresses: {
listen: [
'/ip4/0.0.0.0/tcp/0'
]
},
transports: [
tcp()
],
services: {
upnpNAT: uPnPNAT()
}
})
Install
$ npm i @libp2p/upnp-nat
API Docs
License
Licensed under either of
- Apache 2.0, (LICENSE-APACHE / http://www.apache.org/licenses/LICENSE-2.0)
- MIT (LICENSE-MIT / http://opensource.org/licenses/MIT)
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.