Methods
(async) checkPortStatus(port, hostopt, timeout) → {Array.<string>}
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
port |
Number | Port to check status on. | ||
host |
String |
<optional> |
'127.0.0.1' | Host of where to scan. |
timeout |
Number | 400 | timeout. |
- Source:
Returns:
- [err, success]. success is either of closed/open. Closed if port is not in use, open otherwise
- Type
- Array.<string>
(async) findAPortInUse(postList, hostopt) → {Array.<string>}
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
postList |
Array | Array of ports to check status on. | ||
host |
String |
<optional> |
'127.0.0.1' | Host of where to scan. |
- Source:
Returns:
- [error, port]
- Type
- Array.<string>
Example
// scans 3000 and 3002 only, not 3001.
portscanner.findAPortInUse([3000, 3002], console.log)
(async) findAPortNotInUse()
Finds the first port with a status of 'closed', implying the port is not in
use. Accepts identical parameters as findAPortInUse
- Source:
(async) findAPortWithStatus(…params)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
params |
params |
<repeatable> |
Params as passed exactly to findAPortInUse and findAPortNotInUse. |
- Source: