adds ports to check environment variable.
Checks if the env PORTS_TO_CHECK is set, if so the string is split via "," to get an array of ports to check. If the env is not set, return the default commonly used ports.
This commit is contained in:
1 parent
6ef6720ec0
commit
8715274c9a
1 file changed
+6
-1
+6
-1
@@ -2,12 +2,17 @@ import net from 'net';
|
|||||||
import middleware from './_common/middleware.js';
|
import middleware from './_common/middleware.js';
|
||||||
|
|
||||||
// A list of commonly used ports.
|
// A list of commonly used ports.
|
||||||
const PORTS = [
|
const DEFAULT_PORTS_TO_CHECK = [
|
||||||
20, 21, 22, 23, 25, 53, 80, 67, 68, 69,
|
20, 21, 22, 23, 25, 53, 80, 67, 68, 69,
|
||||||
110, 119, 123, 143, 156, 161, 162, 179, 194,
|
110, 119, 123, 143, 156, 161, 162, 179, 194,
|
||||||
389, 443, 587, 993, 995,
|
389, 443, 587, 993, 995,
|
||||||
3000, 3306, 3389, 5060, 5900, 8000, 8080, 8888
|
3000, 3306, 3389, 5060, 5900, 8000, 8080, 8888
|
||||||
];
|
];
|
||||||
|
/*
|
||||||
|
* Checks if the env PORTS_TO_CHECK is set, if so the string is split via "," to get an array of ports to check.
|
||||||
|
* If the env is not set, return the default commonly used ports.
|
||||||
|
*/
|
||||||
|
const PORTS = process.env.PORTS_TO_CHECK ? process.env.PORTS_TO_CHECK.split(",") : DEFAULT_PORTS_TO_CHECK
|
||||||
|
|
||||||
async function checkPort(port, domain) {
|
async function checkPort(port, domain) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|||||||
Reference in new issue
Block a user