summaryrefslogtreecommitdiff
path: root/down/http.php
diff options
context:
space:
mode:
authorroot2014-12-05 05:06:52 +0100
committerroot2014-12-05 05:06:52 +0100
commit1ffa65c88b570aca2b5d3b9b7202e30beeee2fe7 (patch)
tree6f9ac147713e39c0fe374307c8228287b1dad8c7 /down/http.php
parentfe476696fb1200d0ea366d056dca976cb45373f9 (diff)
downloadtools.iamfabulous.de-1ffa65c88b570aca2b5d3b9b7202e30beeee2fe7.tar.gz
Made it ipv6 ready.
Diffstat (limited to 'down/http.php')
-rw-r--r--down/http.php10
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);