curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, false);
curl_setopt($ch, CURLOPT_PROXYTYPE, $this->proxy['type']);
curl_setopt($ch, CURLOPT_PROXY, $this->proxy['host']);
curl_setopt($ch, CURLOPT_PROXYPORT, $this->proxy['port']);
print_r($this->proxy);
Array
(
[host] => 127.0.0.1
[port] => 1080
[type] => 5
[user] =>
[pass] =>
)
代理是shadowsocks
浏览器用ss代理访问url 没问题
我php curl 通过代理访问
couldn't connect to host
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
必须是 CURLPROXY_SOCKS5