dongyuxiao6295 2019-03-08 10:41
浏览 880

cURL输出中“local_ip”和“primary_ip”的含义是什么?

I am trying to connect to a site with curl but it returns error 503.

I thought maybe the site blocked my IP. I bought another IP for my VPS and connected with this IP to that site but still I can not connect and have the same error.

I view the cURL output and see two my requests have the same primary IP but different local IP.

The primary IP is not in my purchased IP list. What does primary IP represent in the cURL output?

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 
)
  • 写回答

1条回答 默认 最新

  • douzhan1963 2019-03-08 10:44
    关注

    The local IP is the IP local to you. i.e. it is your IP address.

    The primary IP is the IP you are making the request to. i.e. it is the IP that adsl.tci.ir resolves to.

    [ ~ ] ➜  host adsl.tci.ir
    adsl.tci.ir has address 217.218.86.7
    
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度