先上代码
public static function curl_get_https($url){
echo $url;
$curl = curl_init(); // 启动一个CURL会话
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); // 跳过证书检查
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); // 从证书中检查SSL加密算法是否存在
curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl,CURLOPT_PROXY,'123.163.160.171');
curl_setopt($curl,CURLOPT_PROXYPORT,'8787');
curl_setopt ($curl, CURLOPT_TIMEOUT, 20);
$tmpInfo = curl_exec($curl); //返回api的json对象
curl_close($curl);
return $tmpInfo; //返回json对象
}
执行时报错信息
Proxy CONNECT aborted due to timeout
添加回答
举报
0/150
提交
取消