I\'m able to access my laptop web server using the Android emulator, I\'m using 10.0.2.2:portno
works well.
But when I connect my real Android phone, th
This solution is usable when your mobile device and computer is not in same network:
You need to use port forwarding in this case. In the Google chrome inspect window (chrome://inspect) You can see the connected devices.
Click on the port fowading button, and set a random port say 3000 to the port which your laptop uses say 8080.
now use localhost:3000 from device to access the localhost:8080(or_whatever_ip:portno) in the laptop. You can check it in the mobile browser. Try localhost:3000 in the mobile browser. Make sure to check the "Enable port forwarding" checkbox in the "Port forwarding settings" window