curl如何通过代理IP请求https网址
一、命令行:
curl -x IP:PORT -k 'https://SITE'
结果: curl: (56) Proxy CONNECT aborted
二、PHP代码
$ip = "IP:PORT";
$url = "https://SITE";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_PROXY, $ip);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
var_dump($output);
结果:boolean(false)
RT,这个问题让我好头疼,网站没搜到资料,求问有什么方式可以实现我的需求吗?
vodevil
9 years, 3 months ago