Skip to content

@pumpkin-plugins/port-mapping API / mapper / MapperOptions

Interface: MapperOptions ​

Defined in: tools/port-mapping/src/mapper.ts:41

Settings of a PortMapper.

Extends ​

Properties ​

leaseSeconds ​

leaseSeconds: number

Defined in: tools/port-mapping/src/mapper.ts:43

How long routers keep a mapping without a renewal. Renewed at half this time.


log? ​

optional log?: (message, level?) => void

Defined in: tools/port-mapping/src/mapper.ts:50

Where messages for the server log go. Failures come with the level warn, and each is said once until a port opens, so a router that stays away doesn't fill the log.

Parameters ​

message ​

string

level? ​

"info" | "warn"

Returns ​

void


natPmp ​

natPmp: boolean

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

Look for NAT-PMP gateways.

Inherited from ​

DiscoveryOptions.natPmp


natPmpGateway? ​

optional natPmpGateway?: Endpoint

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

The NAT-PMP gateway to use. Without it the usual router addresses of the local network are tried.

Inherited from ​

DiscoveryOptions.natPmpGateway


onRefused? ​

optional onRefused?: (refusal) => void

Defined in: tools/port-mapping/src/mapper.ts:52

Called once when the screen turns the router down. The mapper logs nothing about it.

Parameters ​

refusal ​
identity ​

RouterIdentity

reason ​

string

Returns ​

void


random? ​

optional random?: () => number

Defined in: tools/port-mapping/src/mapper.ts:54

A number in [0, 1), for choosing another public port when the first is taken.

Returns ​

number


screen? ​

optional screen?: Screen

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

Turns routers down by what they are. It sees every router that gives away its make and model, before anything is asked of it, and a router it gives a reason for is not used: when that leaves no router, discovery throws a RouterRefusedError. Without it routers are not identified.

Inherited from ​

DiscoveryOptions.screen


searchMs? ​

optional searchMs?: number

Defined in: tools/port-mapping/src/mapper.ts:45

How long a UPnP search waits for answers.


ssdp? ​

optional ssdp?: Endpoint

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

Where to send UPnP searches. Defaults to the SSDP multicast group; a router's own address works when multicast is blocked.

Inherited from ​

DiscoveryOptions.ssdp


upnp ​

upnp: boolean

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

Look for UPnP gateways.

Inherited from ​

DiscoveryOptions.upnp

Pumpkin Plugins documentation