diff options
Diffstat (limited to 'down/http.php')
| -rw-r--r-- | down/http.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/down/http.php b/down/http.php index 9973cb4..5e0351d 100644 --- a/down/http.php +++ b/down/http.php @@ -1,7 +1,14 @@ <?php -function isUp($url){ +function isUp($url, $ipv6 = false){ + $agent = "Just checking if you are up or not."; $ch=curl_init(); + + if ( $ipv6 ){ + $url = "[".$url."]"; + curl_setopt($ch,CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V6); + } + curl_setopt ($ch, CURLOPT_URL,$url ); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_NOBODY, true); @@ -11,6 +18,7 @@ function isUp($url){ curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch,CURLOPT_SSLVERSION,3); curl_setopt($ch,CURLOPT_SSL_VERIFYHOST, FALSE); + $page=curl_exec($ch); $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); |
