@pumpkin-plugins/port-mapping API / mapper / MapperOptions
Interface: MapperOptions
Defined in: tools/port-mapping/src/mapper.ts:42
Settings of a PortMapper.
Extends
Omit<DiscoveryOptions,"searchMs">
Properties
leaseSeconds
leaseSeconds:
number
Defined in: tools/port-mapping/src/mapper.ts:44
How long routers keep a mapping without a renewal. Renewed at half this time, and at least every five minutes.
log?
optionallog?: (message,level?) =>void
Defined in: tools/port-mapping/src/mapper.ts:49
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:16
Look for NAT-PMP gateways.
Inherited from
natPmpGateway?
optionalnatPmpGateway?:Endpoint
Defined in: tools/port-mapping/src/discover.ts:18
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:51
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:53
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:25
Turns routers down by what they are. It sees every UPnP 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, or no router answers and a web interface is recognized, discovery throws a RouterRefusedError. Without it routers are not identified.
Inherited from
searchMs?
optionalsearchMs?:number
Defined in: tools/port-mapping/src/mapper.ts:55
How long a UPnP search waits for answers.
ssdp?
optionalssdp?:Endpoint
Defined in: tools/port-mapping/src/discover.ts:29
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:31
Look for UPnP gateways.