How to find Connected Clients Ip Address in grails

I am doing a small grails project. I am trying to add network concepts in these projects, you can be guided by how to work with it.

Requirement: -

I run my project in my local host (http: // localhost: 8080 / xyz). So if another person accesses the project with the same local host (http: //192.168.xx: 8080 / xyz) .By using the network concept, I should get information about this specific IP address of users who use the same local address (IP address).

I am currently using this query to get the IP address of my system

${request.getScheme()}:${InetAddress.getLocalHost().getHostAddress()} 

but I want the IP address of a specific user who uses this project on the network.

please help me solve this problem.

+1
source share
1 answer

You should just use:

 String addr = request.remoteAddr 
+5
source

Source: https://habr.com/ru/post/1381287/


All Articles