curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

IP address of failed/tried connections?

From: Arthur Murray via curl-library <curl-library_at_cool.haxx.se>
Date: Wed, 1 Jan 2020 19:48:13 -0800

Hi,

I would like to get the IP#(s) of both successful and failed
connections after "curl_easy_perform". For example: If I try to:

curl_easy_setopt(curl, CURLOPT_URL, "http://www.google.com:999");
res = curl_easy_perform(curl);

It will timeout for port 999 but both of these getinfo entries are empty:

curl_easy_getinfo(curl, CURLINFO_PRIMARY_IP, &ip);
curl_easy_getinfo(curl, CURLINFO_ACTIVESOCKET, &sockfd);

How do I programmatically get the tried IPs? (curl -v shows "Trying
[IP#]...", but I'm not looking for debug strings)

Hostnames resolve to many IP #s, different ones at different times of
day and from different geo locations. How can my software access and
use them from libcurl?
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-01-02