cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 9 Jul 2006 22:37:48 +0200 (CEST)

On Sun, 9 Jul 2006, Geff wrote:

>> 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?

Set a custom 'Host:' header accordingly:

   http://curlm.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTHTTPHEADER

> 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.

If this were to be added, I think I would prefer to see it as an option that
adds an entry to the DNS cache. Like 'www.abc.def equals 1.2.3.4'. As
otherwise we'll get trouble with how to deal with the IPs and resolves etc
when the HTTP server responds with a redirect and other edge cases.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2006-07-09