Skip to content

Commit

Permalink
https://github.com/WWBN/AVideo/issues/9819#issuecomment-2599784422
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed Jan 18, 2025
1 parent 4d35800 commit 223162f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions objects/functionsExec.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,18 +358,26 @@ function isLocalPortOpen($port)

function isPortOpenExternal($port, $timeout = 10)
{
global $global;
global $isPortOpenExternalResponse;
$ports = array($port);
//postVariables($url, $array, $httpcodeOnly = true, $timeout = 10)
$isPortOpenExternalResponse = new stdClass();
$response = postVariables('https://search.ypt.me/checkPorts.json.php', $ports, false, $timeout);
$host = parse_url($global['webSiteRootURL'], PHP_URL_HOST);
$postURL = 'https://search.ypt.me/checkPorts.json.php';
$postURL = addQueryStringParameter($postURL, 'host', $host);
$response = postVariables($postURL, $ports, false, $timeout);
if (!empty($response)) {
$json = json_decode($response);
if (!empty($json)) {
$isPortOpenExternalResponse = $json;
return $json->ports[0]->isOpen;
$resp = $json->ports[0]->isOpen;
if($resp){
return true;
}
}
}
_error_log("isPortOpenExternal($port) {$response}");
return false;
}

Expand Down

0 comments on commit 223162f

Please sign in to comment.