Re: Trouble retrieving client IP address in WO 5.2 more info SOLVED
Re: Trouble retrieving client IP address in WO 5.2 more info SOLVED
- Subject: Re: Trouble retrieving client IP address in WO 5.2 more info SOLVED
- From: mjew <email@hidden>
- Date: Tue, 14 Jan 2003 19:16:32 -0800
Chuck,
(And everyone who I have inflicted this thread upon)
I found the solution. Indeed, using the
hKeys = context().request().headerKeys();
call indicated that the "x-webobjects-remote-addr" header key
was not being passed to WebObjects. Instead the new keader key
seemed to be "remote_addr"
In my earlier tests, though, I had merely deleted the "x-webobjects-"
portion of the header key text, thereby leaving me with a header key
of "remote-addr" (with a dash) NOT "remote_addr" with an underscore.
Fixing my idiotic typo enabled the retrieval of the client IP.
I have gone back to the original WO 5.2 Apache adaptor and verified
that it works.
Most of the documentation online still refers to the
"x-webobjects-remote-addr" header key, so there was something to fix,
but it was NOT as complicated as I was making it out to be.
My apologies for the waste of bandwidth, and my thanks for pointing
me in the direction that eventually led me to the solution.
- Matthew
On 1/14/03 4:42 PM, "Chuck Hill" <email@hidden> wrote:
> Take a look at project Wonder. They have some patched adaptors. I don't know
> if they need to be (or have been) updated for 5.2. One of the patches for the
> Apache adaptor passes along all of the headers. I use this to avoid a similar
> problem. It might help you as well.
>
>
> Chuck
>
>
> mjew wrote:
>
>> Chuck,
>>
>> Thanks for the quick response.
>>
>> I am using the Apache adaptor shipped with 5.2
>>
>> I did more research, and am currently inserting a
>> hKeys = context().request().headerKeys();
>>
>> into my page and having it display ALL the headerKeys.
>>
>> I have found the following headerkeys of potential interest:
>> remote_host
>> remote_port
>> remote_addr
>>
>> The only "x-webobjects" headers being passed to me are:
>> x-webobjects-request-id
>> x-webobjects-request-method
>> x-webobjects-adaptor-version
>>
>> I modified the code to use "remote_host" and "remote_addr"
>> in two test fields, put it on the deployment/application
>> server, and I *still* am getting nothing but empty strings.
>>
>> I'm afraid I'll have to resort to having NetCloak stuff the client IP
>> as a cookie value when the person initially arrives. Sigh.
>>
>> - Matthew
>>
>> On 1/14/03 4:11 PM, "Chuck Hill" <email@hidden> wrote:
>>
>>
>>> To make things more intriguing for developers of WebObjects, earlier
>>> developers
>>> of the different adaptors named headers differently. This might have
>>> changed
>>> in
>>> 5.2, check and see if it is there under a different name. Also, not all
>>> adaptors pass all the headers. I'd thought this was supposed to be fixed in
>>> 5.2, but I've not checked. Which adaptor are you using?
>>>
>>>
>>> Chuck
>>>
>>>
>>> mjew wrote:
>>>
>>>
>>>> One more piece of follow-up info regarding retrieving the client IP address
>>>> in a WO 5.2 app via the call:
>>>>
>>>> clientIP = context().request().headerForKey("x-webobjects-remote-addr");
>>>>
>>>> My current deployment is a split install (meaning that the web server
>>>> is NOT the application server). I'm wondering if this could have something
>>>> to do with it.
>>>>
>>>> But it would be quite lame if using a split installation disabled access to
>>>> those header fields, since split installs are the recommended method for
>>>> scaling WebObjects applications across multiple servers for performance
>>>> and high availability.
>>>>
>>>> Does anyone have any information about this?
>>>>
>>>> - Matthew
>>>> _______________________________________________
>>>> webobjects-dev mailing list | email@hidden
>>>> Help/Unsubscribe/Archives:
>>>> http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>>>> Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.