Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 618
jojo Avatar asked May 04 '13 04:05

jojo


People also ask

How do I change port Play framework?

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.

What is the default port for Play application?

Overriding configuration with system properties The default is to listen on port 9000 at the 0.0. 0.0 address (all addresses).


1 Answers

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.

like image 101
PowerPanda Avatar answered Sep 27 '22 22:09

PowerPanda