Atozed Forums
Read HTTP Header Field "Host" - Printable Version

+- Atozed Forums (
+-- Forum: Atozed Software Products (
+--- Forum: IntraWeb (
+---- Forum: English (
+----- Forum: IntraWeb General Discussion (
+----- Thread: Read HTTP Header Field "Host" (/thread-1359.html)

Read HTTP Header Field "Host" - RosenbergFans - 11-05-2019


we have an Intraweb Site (standalone application) where we would like to use TLS (HTTPS) encryption. We are planning to use two domains which will point to the same IP. The Intraweb application should react differently depending from which domain the request is coming (show different pages and use different certification files since certificates are depending on domain?)
I was told to use the HTTP Header Field "Host". How can I read this header field in Intraweb?

RE: Read HTTP Header Field "Host" - Jose Nilton Pace - 11-05-2019

Hi, if you use iw 15+ with http.sys you be able to have a lot of applications running in same Domainserver with one certificate. Ex:

And you have one certificate:

Because http.sys use the same Domain information registered on windows with IIS or without IIS (directly via prompt).

RE: Read HTTP Header Field "Host" - RosenbergFans - 11-06-2019

Thank you, but how can I access the HTTP Header in Intraweb? Is it possible?

RE: Read HTTP Header Field "Host" - Jose Nilton Pace - 11-06-2019

Hi, you have information you can handle like this:

procedure TIWServerController.IWServerControllerBaseNewSession(aSession: TIWApplication);
   ASession.Data := TIWUserSession.Create(nil, aSession);

   { Use ASession.Request to obtain a lot of information }
   if ASession.Request.HttpMethod = hmNone then begin
      ASession.Response.Code     := 405;
      ASession.Response.CodeText := 'Not Allowed';

RE: Read HTTP Header Field "Host" - RosenbergFans - 11-19-2019

One additional question: where is the right place to specify different certificate files if the request comes from different domains which point to the same IP. I can read the WebApplication.Request.Host to determine where the request comes from.

RE: Read HTTP Header Field "Host" - kudzu - 11-19-2019

Alexandre will need to reply for an exact answer, but I don't believe SA supports multiple certificates or one per domain. You may need to use ISAPI or HTTP.SYS to do that. For SA you could also use IIS or Apache and use redirects from the other domains.