1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 19:42:38 +02:00
This commit is contained in:
Daniel Neto 2025-01-13 11:05:33 -03:00
parent fb70c2730d
commit 6fa6cf7dbf
3 changed files with 27 additions and 2 deletions

View file

@ -320,6 +320,22 @@ function zipDirectory($source, $destination)
return file_exists($destinationOriginal);
}
function isPortOpenInternal($host, $port) {
$output = [];
$result = null;
exec("nc -zv {$host} {$port} 2>&1", $output, $result);
foreach ($output as $line) {
_log($line);
}
return $result === 0;
}
function isPortOpenExternal($port) {
$ports = array($port);
//postVariables($url, $array, $httpcodeOnly = true, $timeout = 10)
$response = postVariables('https://search.ypt.me/checkPorts.json.php', $ports, false, 4);
return $response;
}
function getPIDUsingPort($port)
{