cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: finding the interface used when connecting to a url

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 12 Jun 2003 13:33:50 +0200 (CEST)

On Wed, 11 Jun 2003, Hunter Blanks wrote:

> I was looking for some way to find out what network interface / IP address
> was being used to connect to a url.

libcurl doesn't currently offer that information. It already uses
getsockname() on multiple places in the code, so we could indeed consider a
way to export that info to the "outside". It would basicly be a matter of
storing the info and then be able to return it on request.

> I'd imagine it's in the debug information, but the documentation about
> curl_info_type and the debug callback was pretty thin.

I think curl_easy_getinfo() is a suitable function that can be extended to
provide the IP address of an existing connection. We'd only need to make sure
that we use the existing connection, as there might be several ones in the
"cache".

> Does anyone know an easy solution to this issue?

Patching required. Are you up to it?

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
Received on 2003-06-12