0

I have a pretty dumb question. I have a Java server running on my computer, which can be visited on localhost:8080. How do I visit it through my mobile phone (in local network, connected to Wi-Fi)? I tried to open the port or even turn off the firewall. The path Ip address:port doesn't seem to work. Is there something I am missing or forgot to do?

annaoomph
  • 552
  • 1
  • 4
  • 22
  • might help: http://stackoverflow.com/questions/9682262/how-do-i-connect-to-this-localhost-from-another-computer-on-the-same-network – Riad Jan 22 '17 at 12:00
  • Try with a browser on another PC in your network. – greenapps Jan 22 '17 at 12:25
  • Thanks for the link, it seems I have found a solution here. It turned out that the port wasnt listening in local network, so in my config file I had to write not `localhost:8080`, but `0.0.0.0:8080`. The full explanation here: [link](http://stackoverflow.com/a/16743134/7453375) – annaoomph Jan 22 '17 at 12:32

1 Answers1

0

its running on your local machine not on your local network/wifi, what you'll have to do is find your computer IP and use it with the current port if you are on the same network.

in general its bad practice to test server programs like that and its highly recommended to use an Apache server and upload it to a cloud then just run it from there.

Daniel Netzer
  • 2,151
  • 14
  • 22
  • thanks for the answer, I did exactly as you have said, but `Ip address:port` doesnt work – annaoomph Jan 22 '17 at 11:56
  • can you add some code to your question? cause you will have to enter your device definition and your router setup aswell to allow that kind of outside connection. – Daniel Netzer Jan 22 '17 at 12:04
  • `but Ip address:port doesnt work `. What is 'does not work'?? You will have an exception if the client cannot connect. Please provide full details. – greenapps Jan 22 '17 at 12:20
  • `in general its bad practice to test server programs like that ` ??? Why would that be bad practice? It's very ok for me. – greenapps Jan 22 '17 at 12:21
  • IP address:port doesn't work from my mobile browser. it says can not access the website – annaoomph Jan 22 '17 at 12:22
  • Please tell the exception(s) your app generates. – greenapps Jan 22 '17 at 12:23
  • If the browser on your Android device cannot connect with your PC then the firewall is in play. Switch it off. – greenapps Jan 22 '17 at 12:24