cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Option to connect to Arbitary IP?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 10 Apr 2010 13:28:36 +0200 (CEST)

On Sat, 10 Apr 2010, Simon Lyall wrote:

> 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?

Traditionally there are two ways to accomplish this, although not as
convenient as "just" an option:

1. edit /etc/hosts (or equivalent)

2. edit the URL and connect to example.com like:

   curl -H "Host: example.com" http://1.2.3.4/thepage.html

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
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