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 accessible to external IP
i tried to use
http.address=127.0.0.1
on the application.conf , but it didn't seem to make any change.
using netstat i saw that play use 0.0.0.0:9000
Thanks
Go to the project directory and just say play (and nothing after that). That will open the play console. Next, say run 8080. That will start play on port 8080.
Overriding configuration with system properties The default is to listen on port 9000 at the 0.0. 0.0 address (all addresses).
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With