Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to obtain browser client's IP Address(Getting client's actual IP Address in RAP)
How to obtain browser client's IP Address [message #1061343] Fri, 31 May 2013 09:58 Go to next message
John Gymer is currently offline John GymerFriend
Messages: 191
Registered: November 2012
Location: UK
Senior Member
Hi, is there a bullet-proof method to get the IP Address of the physical client that is connected to a RAP (or Tabris) server?

I see in RWT we have:

RWT.getRequest().getRemoteAddr()


...but this may not return the IP address of the client machine itself - it seems to return our proxy server's IP address instead, on our network, which is not good enough for our applications.

Also, this method does not appear to be available in Tabris (RWT.getRequest() hardly has anything implemented), so I need something more generic that will work accurately across all RAP/Tabris clients.

The background to this is that I need to be able to identify each physical device/machine that connects into my RAP server, as I'd like to store preferences for that machine. Perhaps there is another way to do it?

Thanks, John


---
Just because you can doesn't mean you should

[Updated on: Fri, 31 May 2013 10:07]

Report message to a moderator

Re: How to obtain browser client's IP Address [message #1061359 is a reply to message #1061343] Fri, 31 May 2013 10:22 Go to previous messageGo to next message
John Gymer is currently offline John GymerFriend
Messages: 191
Registered: November 2012
Location: UK
Senior Member
Not sure I want to use IP Address after all... just revisiting the SessionStore (cookies?) class again to see if that is really what I need...


---
Just because you can doesn't mean you should
Re: How to obtain browser client's IP Address [message #1061365 is a reply to message #1061359] Fri, 31 May 2013 10:50 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 1853
Registered: July 2009
Senior Member
Hi John,
maybe you mean SettingStore :-)
Best,
Ivan

On 5/31/2013 1:22 PM, John Gymer wrote:
> Not sure I want to use IP Address after all... just revisiting the
> SessionStore (cookies?) class again to see if that is really what I
> need...
>

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: How to obtain browser client's IP Address [message #1061372 is a reply to message #1061365] Fri, 31 May 2013 11:10 Go to previous messageGo to next message
John Gymer is currently offline John GymerFriend
Messages: 191
Registered: November 2012
Location: UK
Senior Member
Hi Ivan,
Thanks, and yes, indeed, I do mean SettingStore.
I had forgotten about that library - works perfectly!
Cheers, John


---
Just because you can doesn't mean you should
Re: How to obtain browser client's IP Address [message #1061376 is a reply to message #1061372] Fri, 31 May 2013 11:34 Go to previous messageGo to next message
John Gymer is currently offline John GymerFriend
Messages: 191
Registered: November 2012
Location: UK
Senior Member
A further question on this... SettingStore uses Cookies, which have a default expiry of 30 days. How do I persist this, or change to non-expiring Cookies? Is it just a case of reading a Cookie, or do I need to update it, or delete+recreate?

The problem as I see it is that if a user makes various preference changes to their display, they don't want to have to do this again after 30 days... or does the 30 days start from the last 'access' (read?) of the Cookie value, in which case it isn't a problem?

Thanks, John


---
Just because you can doesn't mean you should
Re: How to obtain browser client's IP Address [message #1061636 is a reply to message #1061376] Mon, 03 June 2013 11:30 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 1853
Registered: July 2009
Senior Member
Hi John,
the SettingStore cookie is set to expire in 3 months after the last
'access'. With every SettingStore access this cookie is prolonged for
another 3 months.
Best,
Ivan

On 5/31/2013 2:34 PM, John Gymer wrote:
> A further question on this... SettingStore uses Cookies, which have a
> default expiry of 30 days. How do I persist this, or change to
> non-expiring Cookies? Is it just a case of reading a Cookie, or do I
> need to update it, or delete+recreate?
>
> The problem as I see it is that if a user makes various preference
> changes to their display, they don't want to have to do this again
> after 30 days... or does the 30 days start from the last 'access'
> (read?) of the Cookie value, in which case it isn't a problem?
>
> Thanks, John
>

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: How to obtain browser client's IP Address [message #1061643 is a reply to message #1061636] Mon, 03 June 2013 11:44 Go to previous message
John Gymer is currently offline John GymerFriend
Messages: 191
Registered: November 2012
Location: UK
Senior Member
Thank-you Ivan.
That was exactly what I wanted to hear!!
Cheers, John


---
Just because you can doesn't mean you should
Previous Topic:[ANN] RAP 2.1 RC2 is available
Next Topic:SWT.ICON_SEARCH and SWT.ICON_CANCEL not work in the dialog
Goto Forum:
  


Current Time: Sat Nov 22 13:27:56 GMT 2014

Powered by FUDForum. Page generated in 0.05152 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software