问题
I am working on a Mobile website using jquery mobile and would like to test it using my android Phone browser.
My Windows 7 machine and android phone are on the same wireless network.
I normally access the mobile site from my machine: "http://localhost/index.php/doctor"
I tried accessing it using the wireless network IP address from my mobile: "http://192.168.1.3/index.php/doctor"
but, I get web page not available error.
How do I access localhost from my android phone?!
回答1:
192.168.1.3 is the local network address. What you need to do, is get the external IP address, and put that into the phones URL. You can do this by going into the command line and typing ipconfig, this should give you all your machines IP addresses, along with the external IP for your local webserver. I doubt this has anything to do with your firewall. More than likely, you just need to find the correct IP address for your local webserver.
Hope this helps.
来源:https://stackoverflow.com/questions/11401235/access-localhost-from-mobile-phone