Skip to content

@pumpkin-plugins/port-mapping API / discover / discover

Function: discover() ​

discover(net, options): Steps<Discovered>

Defined in: tools/port-mapping/src/discover.ts:60

Finds a router that can open ports. UPnP and NAT-PMP are tried side by side; UPnP wins when both answer.

With a screen, routers are identified first, and nothing is asked of one that is turned down: its web interface is looked at, then UPnP devices describe themselves, and only then are the protocols spoken. That makes a search take longer, since NAT-PMP waits for the UPnP search.

Parameters ​

net ​

Network

options ​

DiscoveryOptions

Returns ​

Steps<Discovered>

Throws ​

When the only routers found are turned down by the screen.

Throws ​

Saying why each protocol found nothing.

Pumpkin Plugins documentation