I started a local http server on Android and it can be reached by other computers in the same local network. But if I try to access this server using opera on the same phone, it won't work. So this means we are not able to access localhost on Android? Thanks!
On your mobile device's browser (any will work), navigate to http://<Local IP Address>:<port number> . For example, if I was serving on localhost:8080 and my local IP address is 123.45. 67.890, on my mobile device's browser I would navigate to http://123.45.67.890:8080 . The http:// is important, don't leave it off.
If you acces "http://localhost" in the browser, the request will not be forwarded to the internet through the router, but will instead remain in your own system. Localhost has the IP address 127.0. 0.1, which refers back to your own server.
You shoud use next IP 10.0.2.2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With