findPort
function · Source
Find an available port within a given range. Parameters
| Name | Type | Description |
|---|---|---|
min | number | The minimum port number. |
max | number | The maximum port number. |
protocol? | "udp4" | "udp6" | The socket type. Default: "udp4". |
interfaceAddresses? | InterfaceAddresses | The interface addresses mapping. |
Returns: Promise<number> — The available port within range.