views:

53

answers:

3

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

TIA

+2  A: 

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 outgoing security of your firewall if you are running one.

Wil
"Accessing localhost from the iPhone will simply do a loopback / try to connect to itself (If it supports that?)" - Of course it supports.Almost same answer as mine ahahahaha ;)
CuSS
@Cuss As I phone has no real need for it, I didn't know if it has a hosts table type thing where they would configure localhost.And, I should be saying your answer is the same as me!
Wil
@Wil - Iphone, like other unix, symbian and win based devices, have the need of loopback because of some applications that connects with others over TCP/IP Loopback address. Almost all devices with network has the loopback ability.
CuSS
Wil and CuSS - Thanks for your suggestions. My first attempt to access the website running in IIS on my Win7 laptop via the IP address resulted in 404. I'll check the firewall settings. Any other checks (traces) I can run to figure out the issue?
rams
+2  A: 

Try this:

Press Windows + R
Write "cmd"
Write "ipconfig"
Check your wireless network card IP
Go to iPhone and put on your browser "http://xxx.xxx.xxx.xxx/" and Enter (xxx.xxx.xxx.xxx is your IP)

NOTE: you must set permission on your firewall settings, if any.

CuSS
A: 

Use the Iphone's sdk live tester

MrThomas