3

I am using the NanoHttpd library to set up a server. It is currently serving a 'Hello World' HTML page. It is accessible from the browser of the phone on which it is deployed but not on other phones or laptops on the same WiFi.

For example, http://10.54.92.228:8080 is accessible to the browser of the phone on which the server is deployed. But, is inaccessible to other devices over the network. Is there any way to enable incoming connections ?

Umang Mathur
  • 833
  • 1
  • 10
  • 32
  • Perhaps you are only listening on `localhost`. Bear in mind that having an open port raises security risks -- be certain that you are properly securing your app. – CommonsWare May 29 '18 at 22:06
  • If you have root on the phone check `iptables -L`. Maybe firewall rules on the phone that forbid connections from outside. – Yuri Lachin May 31 '18 at 11:27
  • Perhaps you are not redirecting your network. See similar question: https://stackoverflow.com/questions/72141536/http-server-in-android-emulator-not-accessible-from-host – dzieciou May 06 '22 at 13:05

1 Answers1

-1

I am working on a similar project, I have to host files over WIFI on an android device which is accessible to anyone on the same WIFI network.
The web server is working as I want.
I think the problem is with your IP-Address of the server.
For a WIFI network, the network should be in the range of 192.168.137.XXX.
What you are inputting is the global ip of the device on which your server is.
Check you local ip, and enter it with the port number and it will work.
Ping me if you need any help.

Shan Singh
  • 104
  • 1
  • 6
  • 192.168.x.x is a reserved range often used for local networks, but so is the entire 10.x.x.x range. The asker *is* using a local IP address, not a routable one. – Chris Stratton Aug 15 '18 at 14:09