cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: IP addresses of redirected servers

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 22 Feb 2011 10:38:14 -0800

On Tue, Feb 22, 2011 at 10:00:45AM -0800, 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

Methinks you haven't read the documentation closely enough...

> libcurl. I can think of two approaches of doing this:
>
> (1) Add a new user provided callback function. Every time when libcurl tries to
> connect to a server, the callback function is called with the server IP
> address.

The CURLOPT_OPENSOCKETFUNCTION does exactly this.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-02-22