cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Clarification on name resolving with and without HTTP proxy server needed

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 6 May 2008 23:46:33 +0200 (CEST)

On Tue, 6 May 2008, Stefan Krause wrote:

> 1) When using an HTTP proxy by configuring an easy handle with CURLOPT_PROXY,
> the proxy server will resolve the DNS name of the server in the URL and not
> libCurl ?

Correct. The entire URL is passed to the proxy which resolves the host name.

> libCurl does not start any name resolving in case the proxy is specified
> with an IP address ?

Exactly.

> 2) When the HTTP proxy server itself is specified via a DNS name, then
> libCurl resolves the
> DNS name to an IP locally (by use of the configured name server for the
> system and the gethostbyname() methods)
> and then forwards the HTTP Request to the proxy which resolves the DNS
> name of the server ?

Yes, although you can build libcurl to use different kinds of name resolves to
resolve that proxy name:

         http://curl.haxx.se/docs/faq.html#How_does_libcurl_resolve_host_na

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2008-05-06