cURL / Mailing Lists / curl-library / Single Mail


Re: IP addresses of redirected servers

From: Daniel Stenberg <>
Date: Tue, 22 Feb 2011 22:14:46 +0100 (CET)

On Tue, 22 Feb 2011, Bin Wang wrote:

> We use libcurl with CURLOPT_FOLLOWLOCATION option turned on. We have a need
> to obtain the IP addresses of all the servers libcurl tries to connect along
> the whole redirection process.
> Since libcurl currently does not provide this, I am thinking about extending
> libcurl. I can think of two approaches of doing this:

Allow me to offer yet another way to solve your problem:


2. Use curl_easy_getinfo's CURLINFO_PRIMARY_IP to get the IP

3. Use curl_easy_getinfo's CURLINFO_REDIRECT_URL to extract redirect URLs and
redirect there "manually".

List admin:
Received on 2011-02-22