我正在尝试使用 curl 连接到站点,但它返回错误 503。
我想也许该网站屏蔽了我的 IP。我为我的 VPS 购买了另一个 IP,并使用此 IP 连接到该站点,但我仍然无法连接并出现相同的错误。
我查看 cURL
输出,发现我的两个请求具有相同的主 IP 但本地 IP 不同。
主 IP 不在我购买的 IP 列表中。 cURL
输出中的主要 IP 代表什么?
Array (
[url] => http://adsl.tci.ir/
[content_type] => text/html; charset=UTF-8
[http_code] => 302
[header_size] => 366
[request_size] => 50
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0.01543
[namelookup_time] => 0.004182
[connect_time] => 0.0057
[pretransfer_time] => 0.005737
[size_upload] => 0
[size_download] => 13458
[speed_download] => 872197
[speed_upload] => 0
[download_content_length] => -1
[upload_content_length] => 0
[starttransfer_time] => 0.015135
[redirect_time] => 0
[redirect_url] => http://adsl.tci.ir/panel
[primary_ip] => 217.218.86.7
[certinfo] => Array ( )
[primary_port] => 80
[local_ip] => 185.208.174.63
[local_port] => 57646
)
最佳答案
本地 IP 是您本地的 IP。即它是您的 IP 地址。
主 IP 是您向其发出请求的 IP。即它是 adsl.tci.ir 解析到的 IP。
[ ~ ] ➜ host adsl.tci.ir
adsl.tci.ir has address 217.218.86.7
关于php - cURL 输出中的 "local_ip"和 "primary_ip"是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55061471/