John ORourke wrote:
Hi folks,

I can't seem to find a way to retrieve the inbound port number during requests.

I have a server listening on multiple ports, and need to know which one the request came in on. Here's the setup:

apache config:
   Listen 127.0.0.1:81
   Listen 127.0.0.1:82
   NameVirtualHost *:*
   <VirtualHost *:*>
      ......
   </VirtualHost>

I believe you could resolve this as follows (although it is really a "brute force" method) : Instead of one <VirtualHost *:*>, you could define 2 sections, entirely copy of eachother except for :

<VirtualHost *:81>
  PerlSetVar ConnType "HTTP"
  ....
</VirtualHost>

<VirtualHost *:82>
  PerlSetVar ConnType "HTTPS"
  ....
</VirtualHost>

and then in your script/handler get the ConnType config value to tell the difference.

AW


Reply via email to