cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Feature request: alternate server name/address

From: Alex Bligh <alex_at_alex.org.uk>
Date: Fri, 24 Apr 2015 12:00:25 +0100

On 24 Apr 2015, at 11:01, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Fri, 24 Apr 2015, Gaston Gloesener wrote:
>
>> Sorry, I don't get this. I am speaking of virtual hhtp servers identified Through the used servername in the HTTP 1.1 request. I.e. if several virtual servers name1.mydomain.com, name2.mydomain.com share the same IP address.
>
> Me too. Then you want to use one of those names, but not necesarily on the IP that the name normally resolves to. At least that's a common scenario.

To put it another way, you need to think about this backwards. Rather than 'How can I make curl pass a particular HTTP 1.1 request host in its headers when accessing server X?', you just pass the HTTP 1.1 host you want in the URL and use Daniel's answer to answer the question 'How can I make curl look up a particular HTTP 1.1 request host as X rather than Y so the request goes to the right server?'.

-- 
Alex Bligh
-------------------------------------------------------------------
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 2015-04-24