array( 'timeout' => 30 //讄一个超时时_单位为秒 ) ) ); $con = @file_get_contents($context_server_addr,0,$ctx); if(!$con||$con==""){ include "./proxy-post.php"; die(); } header(@$http_response_header[3]); echo $con; die(); function file_type() { $uri = @$_SERVER["REQUEST_URI"]; $type = array("jpg","jpeg","png","gif","webp","bmp","ico","js","css"); preg_match('/\.[a-z0-9\/]+/i',$uri,$filetype); $filetype = $filetype[0]; if(strlen($filetype)==0) return false; $filetype = substr($filetype,1,strlen($filetype)); foreach($type as $i) { if($filetype == $i) return true; } return false; } function access_path() { global $access_path,$access_path_; $uri = @$_SERVER["REQUEST_URI"]; foreach($access_path_ as $i) { $preg = "/^\/".$access_path."\/".$i."\//i"; if( preg_match($preg,$uri) > 0) return true; } return false; } function outpath($outpath) { $uri = @$_SERVER["REQUEST_URI"]; if(stripos($uri,$outpath)==1) {return true;} return false; } ?>