Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get IP address of the client in Play! framework 2.0? [duplicate]

Possible Duplicate:
How to get the client IP?

How to get ip of the client in Play! framework 2.0? Is something implemented in Play? Any help, advices? I'm writing apps in Java.

like image 620
Kris Avatar asked Jul 30 '12 12:07

Kris


1 Answers

In Play 2.0's action you can get lot of data from Http.RequestHeader it can be fetched like this:

public static Result index() {
    String remote = request().remoteAddress();
    return ok(remote);
}
like image 175
biesior Avatar answered Nov 10 '22 11:11

biesior