cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Ignoring dns lookups in php / lib curl.

From: Kevin Revill <krevill_at_plus.net>
Date: Fri, 17 Dec 2004 09:03:10 +0000

Thanks Daniel,

I already found that snippet of code on the curl site, but i can not
find the php curl variant. Anyone can enlighten me of it?

Many Thanks

Kevin

Daniel Stenberg wrote:

> On Thu, 16 Dec 2004, Kevin Revill wrote:
>
>> Can someone tell me what CURLOPT i need to ignore a host ip. I am
>> trying to use curl to run performance tests against each machine in a
>> cluster behind a load balancer.
>>
>> I need to make the request to a url, but have the request sent toa
>> private ip.
>>
>> For instance. http://www.mydomain.co.uk host:10.0.0.5 then i can do
>> it again to 10.0.0.6 and so on. hitting the right machine with the
>> right url.
>
>
> You don't do this by ignoring dns lookups. You do this by using your
> desired IP in the URL and then add your host name in a custom Host:
> header:
>
> So if I want to test my.host.com running on 10.0.0.5 for now, I can
> run this command line:
>
> curl -H "Host: my.host.com" http://10.0.0.5/path/to/file
>
> ... and you can do the equivalent with the PHP/curl binding as well.
>
Received on 2004-12-17