문제

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

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top