Re: Browser's or Client's hostname or ip-address
"Guido Neitzer" <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.devel |
|---|---|
| Message-ID | <[email protected]> |
On 10/25/06, COAST <[email protected]> wrote: > Is there already a solution for this problem? (Like an additional > functionality in webobjects.dll > which would send the ip-address of the client in the http-header) Copy and Paste from ERXRequest from ProjectWonder: /** * Returns the remote host name. Works in various setups, like * direct connect, deployed etc. If no host name can be found, * returns "UNKNOWN". */ public String remoteHost() { String host = null; if (WOApplication.application().isDirectConnectEnabled()) { InetAddress hostAdd = _originatingAddress(); if (hostAdd != null) { host = hostAdd.getHostAddress(); return host; } } if (host == null) { host = headerForKey("remote_host"); if (host != null) return host; host= headerForKey("remote_addr"); if (host != null) return host; host = headerForKey("remote_user"); if (host != null) return host; host = headerForKey("x-webobjects-remote-addr"); if (host != null) return host; } return "UNKNOWN"; } -- PostgreSQL Bootcamp, Big Nerd Ranch Europe, Nov 2006 http://www.bignerdranch.com/news/2006-08-21.shtml