playframework-2.0

Force Play Framework to listen on localhost only


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


Solution

  • 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.