@pumpkin-plugins/port-mapping API / discover / discover
Function: discover()
discover(
net,options):Steps<Discovered>
Defined in: tools/port-mapping/src/discover.ts:70
Finds a router that can open ports. When both protocols are enabled, UPnP search and description reads finish before NAT-PMP starts. Their protocol requests then run together, with UPnP preferred when both answer.
With a screen, UPnP descriptions are screened before any protocol request, and a rejected router receives none. When no router answers either protocol, the web interface at the usual router addresses is probed, so that a recognized router can be named as the reason.
Parameters
net
options
Returns
Throws
When the only routers found are turned down by the screen.
Throws
Saying why each protocol found nothing.