make GET with 2 hosts. Strange but necessary.

make GET with 2 hosts. Strange but necessary.

am 21.09.2006 03:31:42 von ZekyTrash

Hi.

I Need to make a connection to a host "A" and execute a GET with a
header "Host" pointing to host "B"

To be more clear, i'm trying to do something that could be replicated
as:

===========
telnet hostB 80

GET /test.html HTTP/1.1
Host: hostA
===========

I tried with ServerXMLHttp setting the open to "http://hostB/test.html"
and "hostA" as Host in headers... but didn't work.

The reason i need this is that hostB is an IP from a device that does
some processing on "http://hostA/test.html"

i can make a COM that establish the telnet connection to port 80 and do
the GET...but I'm trying to keep it simple... if there's an easier
way....


Any help is more than welcome

Re: make GET with 2 hosts. Strange but necessary.

am 21.09.2006 09:52:03 von Anthony Jones

wrote in message
news:1158802302.677876.287810@i42g2000cwa.googlegroups.com.. .
> Hi.
>
> I Need to make a connection to a host "A" and execute a GET with a
> header "Host" pointing to host "B"
>
> To be more clear, i'm trying to do something that could be replicated
> as:
>
> ===========
> telnet hostB 80
>
> GET /test.html HTTP/1.1
> Host: hostA
> ===========
>
> I tried with ServerXMLHttp setting the open to "http://hostB/test.html"
> and "hostA" as Host in headers... but didn't work.
>
> The reason i need this is that hostB is an IP from a device that does
> some processing on "http://hostA/test.html"
>
> i can make a COM that establish the telnet connection to port 80 and do
> the GET...but I'm trying to keep it simple... if there's an easier
> way....
>

Nope your messing with HTTP at a low level, to do this you will basicaly
need to do it at the socket level.

Are you sure need to do it this way. Can you not get what you need by
adding host headers to the site and/or extra DNS entries?

>
> Any help is more than welcome
>

Re: make GET with 2 hosts. Strange but necessary.

am 21.09.2006 12:23:14 von ZekyTrash

Anthony Jones ha escrito:


>
> Nope your messing with HTTP at a low level, to do this you will basicaly
> need to do it at the socket level.
>
> Are you sure need to do it this way. Can you not get what you need by
> adding host headers to the site and/or extra DNS entries?
>

Thanks for your reply.

No, i have to establish the connection to hostB and send the Host
header of hostA. I also have to send some aditional headers for
Authorization and cache control.
The other reason is that hostB is not just one machine, i have to make
this thing to several servers sending the same request to all of them
(so adding a DNS entrie won't work, plus i still need to be able to
access to hostA normally)

i guess i'll have to make it the hard way then.... Thanks.