Saved,由于原有whoisAPI失效,改用WHOIS命令查询,速度更快,但是需要安装whois命令,RHEL下yum install whois即可

This commit is contained in:
2024-01-29 22:00:02 +08:00
parent 2a00928da5
commit 872eabc111
23 changed files with 274 additions and 41 deletions
+25 -2
View File
@@ -7,6 +7,29 @@ use yzh52521\EasyHttp\Http;
use yzh52521\EasyHttp\RequestException;
use GeoIp2\Database\Reader;
$whois = Http::get('https://api.devopsclub.cn/api/whoisquery?type=json&standard=true', ['domain' => "laysense.com"])->body();
print_r(json_decode($whois));
declare(ticks = 1);
function whoislookup($domain){
$whois = new Whois();
$query = $domain;
$result = $whois->Lookup($query,false);
echo '<pre>';
print_r($result);
echo '</pre>';
}
function sig()
{
throw new Exception;
}
try
{
pcntl_alarm(5);
pcntl_signal(SIGALRM, "sig");
whoislookup('layso.de');
pcntl_alarm(0);
}
catch(Exception $e)
{
echo "timeout\n";
}
?>