正在显示
1 个修改的文件
包含
20 行增加
和
1 行删除
| @@ -75,9 +75,10 @@ class CountAllProject extends Command | @@ -75,9 +75,10 @@ class CountAllProject extends Command | ||
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | public function httpGetProxy($url){ | 77 | public function httpGetProxy($url){ |
| 78 | + $ip_port = $this->httpGet("http://proxy.globalso.com/get_proxy.php"); | ||
| 78 | $ch1 = curl_init(); | 79 | $ch1 = curl_init(); |
| 79 | $timeout = 0; | 80 | $timeout = 0; |
| 80 | - $proxy = '69.90.188.183:51395'; // 替换为你的代理 IP 和端口 | 81 | + $proxy = 'http://'.$ip_port; // 替换为你的代理 IP 和端口 |
| 81 | curl_setopt($ch1, CURLOPT_URL, $url); | 82 | curl_setopt($ch1, CURLOPT_URL, $url); |
| 82 | curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true); | 83 | curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true); |
| 83 | curl_setopt($ch1, CURLOPT_PROXY, $proxy); | 84 | curl_setopt($ch1, CURLOPT_PROXY, $proxy); |
| @@ -95,6 +96,24 @@ class CountAllProject extends Command | @@ -95,6 +96,24 @@ class CountAllProject extends Command | ||
| 95 | return json_decode($content, true); | 96 | return json_decode($content, true); |
| 96 | } | 97 | } |
| 97 | 98 | ||
| 99 | + public function httpGet($url){ | ||
| 100 | + $ch1 = curl_init(); | ||
| 101 | + $timeout = 0; | ||
| 102 | + curl_setopt($ch1, CURLOPT_URL, $url); | ||
| 103 | + curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true); | ||
| 104 | + curl_setopt($ch1, CURLOPT_ENCODING, ''); | ||
| 105 | + curl_setopt($ch1, CURLOPT_MAXREDIRS, 10); | ||
| 106 | + curl_setopt($ch1, CURLOPT_HTTPHEADER, array()); | ||
| 107 | + curl_setopt($ch1, CURLOPT_CONNECTTIMEOUT, $timeout); | ||
| 108 | + curl_setopt($ch1, CURLOPT_SSL_VERIFYPEER, FALSE); | ||
| 109 | + curl_setopt($ch1, CURLOPT_SSL_VERIFYHOST, FALSE); | ||
| 110 | + curl_setopt($ch1, CURLOPT_FOLLOWLOCATION, true); | ||
| 111 | + curl_setopt($ch1, CURLOPT_CUSTOMREQUEST, 'GET'); | ||
| 112 | + curl_setopt($ch1, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); | ||
| 113 | + $access_txt = curl_exec($ch1); | ||
| 114 | + curl_close($ch1); | ||
| 115 | + return $access_txt; | ||
| 116 | + } | ||
| 98 | 117 | ||
| 99 | public function sixProject(){ | 118 | public function sixProject(){ |
| 100 | $projectModel = new Project(); | 119 | $projectModel = new Project(); |
-
请 注册 或 登录 后发表评论