cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Server IP address

From: Christopher Conroy <cconroy_at_gmail.com>
Date: Wed, 7 Apr 2010 20:09:48 -0400

On Wed, Apr 7, 2010 at 3:24 AM, Ruben Thijssen <thijssen_at_fox-it.com> wrote:
>
> Hi,
>
>
>
> I am currently working on a project where I use the curl library.
>
> Curl is working fine but I have a question about multiple IP addresses on one host.
>
> When curl is visiting a URL that has more than 1 IP address. Which IP address is curl choosing and/or how can I see which IP address is used to connect to the webpage?
>
>
>
> Thanks in advance.
>
>
>
> Ruben.
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette:  http://curl.haxx.se/mail/etiquette.html

Ruben,

Are you asking about DNS resolution? If so, that's typically handled
by c-ares alongside libcurl. If not, you'll need to explain a bit more
clearly.

If you want to figure what IP the connection ended up with, you can
query CURLINFO_PRIMARY_IP
see: http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html

--
Chris Conroy
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-04-08