cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: get server ip from load balanced redirect?

From: Drew Canitz <drewcanitz_at_gmail.com>
Date: Tue, 30 Oct 2007 11:20:28 -0400

I was able to get CURLINFO_EFFECTIVE_URL to give me a valid URL, but it was
just the same URL that I gave to the curl object.

Using your suggestion I got the socket and used getpeername into a
sockaddr_in structure, but always get the same IP.

I think that all traffic must be routed through a single point, so my
debugging attempt was flawed from the start.

Thanks for all the good info though!

On 10/27/07, Markus Koetter <koettermarkus_at_gmx.de> wrote:
>
> Hi,
>
> to retrieve the ip address of a established curl http connection:
>
> either:
> CURLINFO_LASTSOCKET & curl_easy_getinfo() to retrieve the last socket
>
> or:
> push the easy handle into a multi and retrieve the multis sockets using
> curl_multi_fdset, got to figure out.
>
> http://curl.haxx.se/libcurl/c/curl_multi_fdset.html
>
>
> I guess the CURLINFO_EFFECTIVE_URL as mentioned before won't work as the
> url is written only once the whole easy process is done?
>
>
> MfG
> Markus
>
Received on 2007-10-30