Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running Spring app on local network IP 192.168.X.X

I run my Spring web app on localhost, so both addresses work:

http://localhost:9999/app

http://127.0.0.1:9999/app

I would also like to see this app running on concrete IP of my machine (in order to access it from a mobile, but that is less important here). I used ipconfig to obtain my IPv4, but when I use it like so:

http://192.168.1.4:9999/app

I get 'this site can't be reached'. That's still on my local machine, not mobile. Is there something else I should set up to make it work?

EDIT: here's a PrintScreen illustrating the problem. I don't think this is a matter of app configuration, because server console should show up in all cases, even if there is no app deployed or running.

enter image description here

like image 505
jarosik Avatar asked Sep 21 '16 17:09

jarosik


1 Answers

all you need to do is add this to your app.properties (or whatever you called spring properties file)

server.address=<your_ip>

just as described here

like image 145
WrRaThY Avatar answered Oct 08 '22 03:10

WrRaThY