cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_easy_setopt to allow for specifying the IP for connect() ?

From: Geff <boing_at_boing.com>
Date: Sun, 09 Jul 2006 12:53:07 -0700

Daniel Stenberg wrote:
> On Sat, 8 Jul 2006, Geff wrote:
>
>> I'm trying to avoid DNS lookups. I want to provide the IP for the
>> connection from some other method. I've been searching the lists and
>> the help pages and the documentation. I haven't found any way to be
>> able to do something like the following:
>>
>> curl_easy_setopt(CURLOPT_IP,"1.2.3.4");
>> /* with whatever data type - string probably not the best choice, but a
>> possibility */
>>
>> Is that possible?
>
> No, you need to use the address in the URL itself:
>
> curl_easy_setopt(easy, CURLOPT_URL, "http://1.2.3.4/");

But then can I also specify the virtual host name somewhere else?
www.abc.com?

>
>> or something else appropriate. I'm pretty flexible here.
>
> You didn't really tell us what you want this for so I can't suggest much
> else.

I'm trying to avoid DNS lookups, as I said before. I have my own
functions for resolving IPs such that I'm not held captive to the
resolver timing out. I guess I could link with my own resolver library,
tho that seems like trouble.

Would you be opposed to a patch to take such an option (CURLOPT_IP), by
using inet_pton() or something? I'm guessing this is a small patch.

Geff
Received on 2006-07-09