Get client IP address from js file in security.authenticate

Using Servoy to administrate the content of your website? Discuss all webrelated Servoy topics on this forum!

Get client IP address from js file in security.authenticate

Postby erikd » Tue Feb 15, 2011 5:55 am

Hi, browsing some topics in the forum, I have learned that a js file in a module for security.authenticate is executed in the server. Thus, application.getIPAddress() will always return the server's ip address if executed in that js file. Does Servoy have an API for getting the IP Address of the remote client? I think this can be done as I saw through debug mode that the remote thread has properties of the following:[RMI TCP Connection(13)-111.222.333.444].
erikd
 
Posts: 445
Joined: Wed Aug 11, 2010 2:32 am

Re: Get client IP address from js file in security.authentic

Postby patrick » Tue Feb 15, 2011 10:03 am

With our UserManager plugin for example this is easily doable...
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Get client IP address from js file in security.authentic

Postby jcompagner » Tue Feb 15, 2011 11:25 am

application.getIPAdress() should give you also for webclients the hosthostAddress
which should be the remote address of the client.

We return there the address that is shown also on the admin pages where we list the clients:

Client: 127.0.0.1[XXX.2.228.4] (Servoy Web Client)

we return the adress between the []
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Web Development

Who is online

Users browsing this forum: No registered users and 8 guests