Optional
autofalse
Optional
externalBy default we query discovered/configured gateways for their external address. To specify it manually instead, pass a value here.
Typically this would be an IPv4 address that the router performs NAT with.
Optional
externalCheck if the external address has changed this often in ms. Ignored if an external address is specified.
30000
Optional
externalDo not take longer than this to check if the external address has changed in ms. Ignored if an external address is specified.
10000
Optional
gatewayHow often to search for network gateways in ms.
This interval is used after a gateway has been found on the network.
300_000
Optional
gatewayHow often to send the M-SEARCH
SSDP message during a gateway search in
ms.
Some routers are flaky and may not respond to every query so decreasing this will increase the number of search messages sent before the timeout.
This interval is used after a gateway has been found on the network.
10_000
Optional
gatewayHow long to search for gateways for before giving up in ms.
This timeout is used after a gateway has been found on the network.
60_000
Optional
gatewaysBy default we search for local gateways using SSDP M-SEARCH messages. To manually specify a gateway instead, pass values here.
A lot of ISP-provided gateway/routers are under powered so may need rebooting before they will respond to M-SEARCH messages.
Each value is an IPv4 or IPv6 URL of the UPnP device descriptor document,
e.g. http://192.168.1.1:8080/description.xml
. Please see the
documentation of your gateway to discover the URL.
Note that some gateways will randomize the port/path the descriptor document is served from and even change it over time so you may be forced to use an SSDP search instead.
Optional
initialHow often to search for network gateways in ms.
This interval is used before a gateway has been found on the network, after
that it switches to gatewaySearchInterval
which lowers the frequency of
the search.
5_000
Optional
initialHow often to send the M-SEARCH
SSDP message during a gateway search in
ms.
Some routers are flaky and may not respond to every query so decreasing this will increase the number of search messages sent before the timeout.
This interval is used before a gateway has been found on the network, after
that it switches to gatewaySearchMessageInterval
which lowers the
frequency of search messages sent.
1_000
Optional
initialHow long to search for gateways for before giving up in ms.
This timeout is used before a gateway has been found on the network, after
that it switches to gatewaySearchTimeout
which increases the timeout to
give gateways more time to respond.
5_000
Optional
portWhether to automatically refresh UPnP port mappings when their TTL is reached
true
Optional
portA pre-configured instance of a NatAPI client can be passed as an option, otherwise one will be created
Optional
portA string value to use for the port mapping description on the gateway
Optional
portHow long before a port mapping expires to refresh it in ms
60_000
Optional
portHow long UPnP port mappings should last for in ms
720_000
Any mapped addresses are added to the observed address list. These addresses require additional verification by the
@libp2p/autonat
protocol or similar before they are trusted.To skip this verification and trust them immediately pass
true
here