João Oliveira 411a0495c5
feat(upnp): add implementation based on IGD protocol
Implements UPnP via the IGD protocol. The usage of IGD is an implementation detail and is planned to be extended to support NATpnp.

Resolves: #3903.

Pull-Request: #4156.
2023-09-12 10:29:27 +00:00

597 B

Description

The upnp example showcases how to use the upnp network behaviour to externally open ports on the network gateway.

Usage

To run the example, follow these steps:

  1. In a terminal window, run the following command:

    cargo run
    
  2. This command will start the swarm and print the NewExternalAddr if the gateway supports UPnP or GatewayNotFound if it doesn't.

Conclusion

The upnp example demonstrates the usage of libp2p to externally open a port on the gateway if it supports UPnP.