How can you force the Play Framework listen on localhost only
i would like that the play will listen on the localhsot:9000 and not on 0.0.0.0:9000
so it won\'t be ac
Sad hack around is simply to block off that port to the outside world. Below you're allowing local access, but banning everyone else. This will keep people from bypassing your proxy (i.e. getting around HTTPS if you terminate there).
iptables -A INPUT -s 127.0.0.1/32 -p tcp -m tcp --dport 9000 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 9000 -j DROP
If you bork your iptables
settings, just run the following to reset them. PS, don't screw with port 22 if your on a remote VM. ;)
iptables -F
You need to use "localhost" as the http.address target.
play start -Dhttp.address=localhost
For some reason, specifying 127.0.0.1 as http.address
is causing it to bind to 0.0.0.0
, which seems like a bug to me. Using localhost
, however, works.