Re: Finding out client IP.
Re: Finding out client IP.
- Subject: Re: Finding out client IP.
- From: Tanmoy Roy <email@hidden>
- Date: Wed, 30 Nov 2005 18:28:03 +0530
Hi Gennady,
Please find below a code piece that we use for getting the client IP.
public String getIpFromWOContext (WOContext iContext) {
String aUserIP = null;
if (iContext != null) {
if (iContext.request() != null )
aUserIP = iContext.request().headerForKey("remote_addr");
}
return aUserIP;
}
Thanks,
Tanmoy
On 11/30/05, Gennady Kushnir <email@hidden> wrote:
> Hello, List.
>
> Can WO somehow realize, from what IP the request is received?
> I need to restrict some functions of my app to be available from internal
> LAN only.
>
> The method proposed in "Practical WebObjects" does not work.
> And I can't find any WORequest's header containing client IP.
> I made all headers (public NSDictionary headers()) to show up on the screen
> - and client IP was not mentioned there.
>
> Perhaps it is because I test my app running it to Direct Connect?
> But I successfully connected to it from another comp on the net - ant still
> no client IP in headers.
>
>
> Thanks in advance
> Gennady
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
>
--
Best,
Tanmoy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden