httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Saju Pillai" <saju.pil...@gmail.com>
Subject Re: determining if browser is on same machine as server
Date Thu, 10 May 2007 03:04:19 GMT
On 10/05/07, David Wortham <djwortham@gmail.com> wrote:
> Sam,
>  I knew I missed something.  There is a C-string containing the local_ip of
> the server in the conn_rec struct.
>
>  I believe the access from a request_rec would be r->connection->local_ip

There can still be cases where comparing ip's won't help. Your
(misconfigured) browser could be coming through a http-proxy -or - you
could be on a multihomed machine...  though neither of these
conditions would apply to your case I guess.

-srp



>
> Dave
>
>
>
>
>
> On 5/9/07, David Wortham <djwortham@gmail.com> wrote:
> >
> > Sam,
> >    From what I know, which is not much, a server name could be any ID
> > given to a computer.  It could be an IP, it could be a domain or
> > "sub"domain, or it could be any ID defined in a /etc/hosts or equivelent
> > (which would only have to be defined on the visitor's computer).  I believe
> > this value is defined to be whatever your VirtualHost is defined to be.
> > There could be ServerAliases which resolve better than the actual
> > servername.
> >
> >    You can try a local getbyhostname() (which may be OS-dependent an/or
> > deprecated) or something similar, but there is no gurantee you will get a
> > good reverse-IP-lookup resolve.  Try searching the web for "man
> > getbyhostname".  You may need to find something newer to handle IPv6
> > addresses (if that is a concern).
> >
> >    It is true that when a visitor uses "localhost" to access a webserver,
> > it is translated into "127.0.0.1" (I believe on both sides).
> >
> >    I know it's not the best and most definitive answer, but I hope it
> > helps a little.
> >
> > Dave
> >
> >
> >
> > On 5/9/07, Sam Carleton <scarleton@miltonstreet.com> wrote:
> > >
> > > I am working on the access to my kiosk system, one condition I need to
> > > handle in a unique way is when a web browser is run on the same
> > > physical machine as Apache.  It is obvious when using localhost or
> > > 127.0.0.1.  But when the URL is the machine name, I seem to be getting
> > > an IP address.  I do see in r->server->server_hostname, is there any
> > > way to convert that into the IP address?
> > >
> > > Sam
> > >
> >
> >
> >
> > --
> > David Wortham
> > Senior Web Applications Developer
> > Unspam Technologies, Inc.
> > (408) 338-8863
>
>
>
>
> --
> David Wortham
> Senior Web Applications Developer
> Unspam Technologies, Inc.
> (408) 338-8863
>

Mime
View raw message