interface UPnPNATInit {
    autoConfirmAddress?: boolean;
    externalAddressCheckInterval?: number;
    externalAddressCheckTimeout?: number;
    portMappingAutoRefresh?: boolean;
    portMappingClient?: UPnPNATClient;
    portMappingDescription?: string;
    portMappingRefreshThreshold?: number;
    portMappingTTL?: number;
}

Properties

autoConfirmAddress?: boolean

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

Default

false
externalAddressCheckInterval?: number

Check if the external address has changed this often in ms. Ignored if an external address is specified.

Default

30000
externalAddressCheckTimeout?: number

Do not take longer than this to check if the external address has changed in ms. Ignored if an external address is specified.

Default

10000
portMappingAutoRefresh?: boolean

Whether to automatically refresh UPnP port mappings when their TTL is reached

Default

true
portMappingClient?: UPnPNATClient

A preconfigured instance of a NatAPI client can be passed as an option, otherwise one will be created

portMappingDescription?: string

A string value to use for the port mapping description on the gateway

portMappingRefreshThreshold?: number

How long before a port mapping expires to refresh it in ms

Default

60_000
portMappingTTL?: number

How long UPnP port mappings should last for in ms

Default

720_000