开发者

How to find out Connected Clients Ip Address in grails

开发者 https://www.devze.com 2023-04-12 18:35 出处:网络
I am doing small project on grails. I am trying to add networking concepts in this projects can u please guide how to work on it

I am doing small project on grails. I am trying to add networking concepts in this projects can u please guide how to work on it

Requirement:-

I am running my project in my localhost(http://localhost:8080/xyz).So if another person is accessing the project with the same localhost(http://192.168.x.x:8080/xyz).By using the networki开发者_StackOverflowng concept i should get the details of that particular users ip address who using with the same localhost (IP address).

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

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

but i want IP address of particular user who are using this project in network.

please guide me to solve this problem.


You should just be able to use:

String addr = request.remoteAddr
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号