cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Getting IP Adress.

From: Shmulik Regev <shmulbox_at_gmail.com>
Date: Fri, 13 Apr 2007 15:37:49 +0200

I use the following hack that isn't too pretty but has been working
for me for over 2 years (before CURLINFO_LASTSOCKET came to be). Curl
has multiple debug/tracing messages, among which there is a message
containing the IP to which it is connecting. The function which emits
this is 'verboseconnect' in url.c . You will have to setup a debug
callback using CURLOPT_DEBUGFUNCTION and extract the IP from the trace
message.

Note that when using proxies there is little point in this anyway.

Cheers,
Shmul
Received on 2007-04-13