我有这段代码:
(...) //other options...
curl_setopt($this->curl, CURLOPT_HTTPPROXYTUNNEL, true);
curl_setopt($this->curl, CURLOPT_PROXY, "xxx.xxx.xx.xx");
curl_setopt($this->curl, CURLOPT_PROXYPORT, 17600);
curl_setopt($this->curl, CURLOPT_URL, "http://www.randomDomain.com");
curl_setopt($this->curl, CURLOPT_PORT, 80);
$data = curl_exec($this->curl);
var_dump(curl_error($this->curl));
//result is: "Failed connect to www.randomDomain.com:17600; Connection refused"
curl错误告诉我尝试在17600端口上连接randomDomain - 来自代理......
为什么这不是80端口?
答案 0 :(得分:0)
检查代理的访问权限并添加此选项以获取对$ data的响应
curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);