cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Paul Querna <chip_at_corelands.com>
Date: Tue, 11 Jul 2006 23:45:57 -0700

Geff wrote:
> All,
>
> 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:

I haven't verified that this works, but perhaps you can just do this:
curl_easy_setopt(curl, CURLOPT_URL, "http://1.2.3.4/path/foo");
headerList = curl_slist_append(headerList, "Host: bar.example.com");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerList);

Avoiding the whole thing....

-Paul
Received on 2006-07-12