我正在做小项目。我正在尝试在此项目中添加网络概念,请您指导如何进行工作
要求:-
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 networking concept i should get the details of that particular users ip address who using with the same localhost (IP address).
目前,我正在使用此查询来获取系统的IP地址
${request.getScheme()}:${InetAddress.getLocalHost().getHostAddress()}
但我想要在网络中使用此项目的特定用户的IP地址。
请指导我解决这个问题。
最佳答案
您应该可以使用:
String addr = request.remoteAddr
关于grails - 如何在Grails中找出已连接的客户端IP地址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7763338/