thanks...
if I have 2 web sites on the same machine which differ only by host header
name then how do i access each site though code? Since the site is not
configured in the DNS I have to use the IP. However only using the IP will
fail since both my sites are on the same IP.
my understanding may also be terribly wrong.
Subir
> thanks...
> if I have 2 web sites on the same machine which differ only by host
> header name then how do i access each site though code?
I wonder how you access the site at all. Since you enter the "Host" in a
browser's URL field, there's no way to connect to the server -- or am I
missing something here?
> Since the
> site is not configured in the DNS I have to use the IP. However only
> using the IP will fail since both my sites are on the same IP.
> my understanding may also be terribly wrong.
HTTP 1.1, section 14.23 says
"The Host request-header field specifies the Internet host and port number
of the resource being requested, as obtained from the original URI given by
the user or referring resource"
which implies what I've said before -- your construct isn't supported.
Cheers,

Signature
Joerg Jooss
joerg.jooss@gmx.net
Subir - 01 Oct 2004 18:37 GMT
1. You are right, I will not be abe to access it through the browser till I
add an entry in my hosts file or in the DNS. So does it imply that even
through code I have the same restriction?
2. Got it!
Thanks again
Subir
> > thanks...
> > if I have 2 web sites on the same machine which differ only by host
[quoted text clipped - 17 lines]
>
> Cheers,
Joerg Jooss - 02 Oct 2004 08:56 GMT
> 1. You are right, I will not be abe to access it through the browser till
> I
> add an entry in my hosts file or in the DNS. So does it imply that even
> through code I have the same restriction?
Interesting question. I guess the following could even work, but it requires
plain sockets (see System.Net.Sockets.Socket or
System.Net.Sockets.TcpClient):
1. Connect to your web server's socket.
2. Send a HTTP request with a non-absolute URI and a Host header, i.e.
GET /path/to/doc.htm HTTP/1.1
Host: www.foo.org
But this is nothing more but a technical experiment. What's the point in
hosting an inaccessible web server?
Cheers,

Signature
Joerg Jooss
joerg.jooss@gmx.net
Subir - 04 Oct 2004 19:23 GMT
The application is executed right after the website is installed by an msi.
The exe sends a request to the site and checks the response to certify if the
website is installed correctly. Earlier I was creating vroots instead of
websites and the WebRequest was serving me fine. Can you give some suggestion
how I can achieve the same for websites? I can assume that the exe will be
executed on the same machine as the site.
Thanks,
Subir
> > 1. You are right, I will not be abe to access it through the browser till
> > I
[quoted text clipped - 15 lines]
>
> Cheers,
Joerg Jooss - 08 Oct 2004 18:32 GMT
> The application is executed right after the website is installed by
> an msi. The exe sends a request to the site and checks the response
[quoted text clipped - 3 lines]
> websites? I can assume that the exe will be executed on the same
> machine as the site.
Subir,
sorry, I'm somewhat confused. Does this question still relate to the
previous discussion?
Cheers,

Signature
Joerg Jooss
www.joergjooss.de
news@joergjooss.de