cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl function to specify IP address of webserver (bypassing DNS)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 16 Jul 2003 00:36:33 +0200 (CEST)

On Tue, 8 Jul 2003, Henrik Størner wrote:

> So my question is: Would it be possible to implement a libcurl function that
> tells curl which IP-address to connect to, bypassing the normal DNS lookup ?
> Something like
>
> curl_easy_setopt(handle, CURLOPT_SERVER_IP, "192.168.1.2");
> curl_easy_setopt(handle, CURLOPT_URL, "http://www.foo.com/");
> curl_easy_perform(handle);
>
> I guess it *could* be done by mangling the URL to replace the hostname with
> the IP-address I want, then calling curl_easy_setopt with CURLOPT_HTTPHEADER
> and defining the "Host:" header. But I'd rather avoid mangling the URL
> myself.

I don't think this is a feture we need to add to libcurl, as you can make this
happen perfectly easy all by yourself. Yes, it requires you to parse and "fix"
the URL yourself, but it still is a pretty weird operation...

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
Received on 2003-07-16