Question

I am making small website in play framework2.2.0, I want to stop unwanted people which perform invalid action and stop my website , few days ago i read that we can set ip address in application.conf which can not access our website. or I want to stop my website for a perticuler user by ip address in play framework 2.2.0

Was it helpful?

Solution

Play has NOT any built-in solution for access control, the easiest thing you can do is just placing Play application behind some HTTP server in role of proxy and gate-keeper, which will filter it for you, ie. nginx or Apache.

On the other hand you can also intercept each request within Global object of Play which gives you even better flexibility, although you need to implement it yourself.

Edit: Here you have simple sample for matching IP with some pattern: http://www.java2s.com/Code/Java/Network-Protocol/CheckifIPaddressmatchpattern.htm

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top