cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: About IP resolve problem when using HTTP proxy

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 14 Jun 2013 16:40:38 +0200 (CEST)

On Fri, 14 Jun 2013, Jin wrote:

> So I'm using IP resolve option(CURLOPT_RESOLVE) when downloading file from
> individual servers.
>
> But when I'm going to use HTTP proxy, it doesn't resolve IP address
> correctly.

Correct. When you're using a HTTP proxy and pass on a host name based URL, you
leave it to the proxy to resolve the host name to IP address and the client
can't affect that in any way. libcurl doesn't do the name => IP translation
for this case (which you can possibly argue that it should when
CURLOPT_RESOLVE has been used for the host name),

If you want to speak to a specific IP address over a HTTP proxy, you need to
use that IP address in the URL - and then set the correct host name in the
Host: header.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2013-06-14