I have the following frameworks in my app
Ninja, Akka, Spray
How do I get the client's request's ip address ?
My routing is defined as follows:
router.GET.route(urlPrefix + "/method").`with`(classOf[Controller],"method")
I have the following frameworks in my app
Ninja, Akka, Spray
How do I get the client's request's ip address ?
My routing is defined as follows:
router.GET.route(urlPrefix + "/method").`with`(classOf[Controller],"method")
I'm not sure whether your question refers to www.ninjaframework.org or spray.io, but if you're using the former, you can get the remote IP address in your controller method:
As the documentation states (http://www.ninjaframework.org/apidocs/ninja/Context.html#getRemoteAddr--), you have to set the
ninja.ninja.x_forwarded_for_enabled
flag totrue
in your application.conf if your app is running behind a http proxy or load balancer.