curl-library
Re: Name resolution when using a proxy
Date: Tue, 17 Jan 2006 10:02:11 +0200
> (Please don't start a new thread by replying to an old mail, it makes threaded
> displays screwed up.)
>
>> At one time I thought I saw something on this, but now I can't find it in
>> the documentation. When I am using a proxy, how do I (or can I) control
>> whether the target url is resolved locally or by the proxy? I have
>> conditions where I need both choices.
>
> With HTTP the client hands over the full URL to the proxy and the proxy will
> resolve the host name.
>
> If you *really* want to do it client-side, then you need to first resolve the
> name and then "re-arrange" the URL to use IP numericals only and set the Host:
> header to contain the host name you resolved.
>
Note that when the IP contains only numericals and the Host header contains the real host *and* you work with a proxy you may not reach your destination! Some proxies will ignore your Host header (for what ever reason) and will try to use only the dotted IP in the full URL. When working through such proxies your trick will fail when the host you are contacting is really a virtual host. We are doing the same exact trick (for different reasons) and are experiencing such mismatches. Not a lot you can do about it though.
Cheers,
Shmulik Regev
Blue Security
http://www.bluesecurity.com
Received on 2006-01-17