Reputation: 2049
I see in Play! 2.0 there is Http.Context.current() http://www.playframework.org/documentation/api/2.0/java/play/mvc/Http.Context.html#current()
But in Play! 1.2.4 how would I go about getting the current HTTP request's IP Address?
Thanks.
Upvotes: 8
Views: 8101
Reputation: 54884
If you are within the controller, you can do
request.remoteAddress;
Otherwise, you would need to do
Http.Request.current.get().remoteAddress;
Upvotes: 21