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 20:45:38 +0200 (CEST)

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/");

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

> Great library! I like the way I can drive the process and things are using
> non-blocking connect. Very nice. There is no excuse for not using
> non-blocking connects!

Thanks. And yes, non-blocking connects is the better way.

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