@pumpkin-plugins/port-mapping API / mapper / MapperOptions
Interface: MapperOptions ​
Defined in: tools/port-mapping/src/mapper.ts:41
Settings of a PortMapper.
Extends ​
Omit<DiscoveryOptions,"searchMs">
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? ​
optionallog?: (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 ​
natPmpGateway? ​
optionalnatPmpGateway?: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? ​
optionalonRefused?: (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 ​
reason ​
string
Returns ​
void
random? ​
optionalrandom?: () =>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? ​
optionalscreen?: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 ​
searchMs? ​
optionalsearchMs?:number
Defined in: tools/port-mapping/src/mapper.ts:45
How long a UPnP search waits for answers.
ssdp? ​
optionalssdp?: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 ​
upnp ​
upnp:
boolean
Defined in: tools/port-mapping/src/discover.ts:16
Look for UPnP gateways.