close
如何在php curl中加入proxy
// proxy ip & port
$proxy = '200.111.182.6';
$proxyPort = '443';
// 掛proxy
curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_PROXYPORT, $proxyPort);
curl_setopt($ch, CURLOPT_PROXYTYPE, 'HTTP');
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
以上即可!
--
參考自 https://stackoverflow.com/questions/58362147/php-curl-use-proxy-to-https-website-for-example-www-google-com
全站熱搜
留言列表