Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you access a website running on localhost from iPhone browser

I am working on a mobile website and would like to test it using my iPhone browser. My Windows 7 machine and iPhone are on the same wireless network. How do I access localhost from the iPhone? Right now I get a 404 error.

like image 978
rams Avatar asked Jun 28 '10 11:06

rams


People also ask

How do I view a localhost website on my iPhone?

Running localhostNavigate to http://yourname.local:8000 on your phone and you're all set!

How do I access my localhost website?

Usually, you can access the localhost of any computer through the loopback address 127.0. 0.1. By default, this IP address references a server running on the current device. In other words, when your computer requests the IP address 127.0.


1 Answers

Accessing localhost from the iPhone will simply do a loopback / try to connect to itself (If it supports that?).

What you need to do is find the IP of your desktop machine (e.g. If Windows, go to the Command Prompt and type ipconfig or go to Network and Sharing Centre and look up connection status.

Once you have your ip, simply visit that from your browser e.g. http://192.168.0.102.

You may need to open up port 80 (or whatever port your website is running on) in the inbound security of your firewall if you are running one.

Note: don't forget the app's port if what you want is to debug the app in your iPhone's browser like: http://192.168.0.102:3000. In this example 3000 is the default port used by ReactJS.

like image 163
Wil Avatar answered Sep 23 '22 05:09

Wil