cURL / Mailing Lists / curl-users / Single Mail

curl-users

Option to connect to Arbitary IP?

From: Simon Lyall <simon_at_darkmere.gen.nz>
Date: Sat, 10 Apr 2010 10:42:14 +1200 (NZST)

One of the main things I use curl to do is test changes I make to
websites.

What I will do is update a test machine with the change ( say a simple
redirect in apache ) and then use curl to connect to the website and
request the URL to make sure the right data is returned.

The big thing is that the DNS for the domain I am testing does NOT point
at where I want to test.

Currently I use --proxy to connect to the correct IP but this is a bit of
a hack and also doesn't exactly match what I want and breaks some apps: eg
the line:

curl --proxy server12:80 http://www.example.com/test

Requests the following:

GET http://www.example.com/test HTTP/1.1
Host: www.example.com

rather than just the path like this:

GET /test HTTP/1.1
Host: www.example.com

So I guess I am asking for an option to tell curl to connect to a IP that
I give it and ask for the URL normally. Thoughts?

-- 
Simon Lyall  |  Very Busy  |  Web: http://www.darkmere.gen.nz/
"To stay awake all night adds a day to your life" - Stilgar | eMT.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-04-10