mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-30 09:21:35 +00:00
feat: add UPnP NAT manager (#810)
* feat: add uPnP nat manager Adds a really basic nat manager that attempts to use UPnP to punch a hole through your router for any IPV4 tcp addresses you have configured. Adds any configured addresses to the node's observed addresses list and adds observed addresses to `libp2p.multiaddrs` so we exchange them with peers when performing `identify` and people can dial you. Adds configuration options under `config.nat` Hole punching is async to not affect start up time. Co-authored-by: Vasco Santos <vasco.santos@moxy.studio>
This commit is contained in:
@ -2055,6 +2055,15 @@ This event will be triggered anytime we are disconnected from another peer, rega
|
||||
- `peerId`: instance of [`PeerId`][peer-id]
|
||||
- `protocols`: array of known, supported protocols for the peer (string identifiers)
|
||||
|
||||
### libp2p.addressManager
|
||||
|
||||
#### Our addresses have changed
|
||||
|
||||
This could be in response to a peer telling us about addresses they have observed, or
|
||||
the NatManager performing NAT hole punching.
|
||||
|
||||
`libp2p.addressManager.on('change:addresses', () => {})`
|
||||
|
||||
## Types
|
||||
|
||||
### Stats
|
||||
|
Reference in New Issue
Block a user