make GET with 2 hosts. Strange but necessary.

Z

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
 
A

Anthony Jones

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

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,139
Messages
2,570,805
Members
47,356
Latest member
Tommyhotly

Latest Threads

Top