Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding out client IP.



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:
> http://lists.apple.com/mailman/options/webobjects-dev/email@hidden
>
> 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:
http://lists.apple.com/mailman/options/webobjects-dev/email@hidden

This email sent to email@hidden

References: 
 >Finding out client IP. (From: Gennady Kushnir <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.