簡體   English   中英

PHP Curl代理錯誤端口

[英]PHP Curl proxy wrong port

我有以下代碼:

(...) //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端口?

檢查您的代理訪問權限,並添加此選項以獲取對$ data的響應

curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM