libp2p.discovery.upnp package
Submodules
libp2p.discovery.upnp.upnp module
- class libp2p.discovery.upnp.upnp.UpnpManager
Bases:
objectA simple, self-contained manager for UPnP port mapping that can be used alongside a libp2p Host.
- async add_port_mapping(port: int, protocol: str = 'TCP') bool
Request a new port mapping from the gateway.
- Parameters:
port – the internal port to map
protocol – the protocol to map (TCP or UDP)
- Returns:
True on success, False otherwise