MetaGuru
MetaGuru

Reputation: 43843

Any known method to browse PC localhost from iPhone via USB cable (sans wifi)?

When I run a test mobile site in Visual Studio 2010 and it gives me a localhost:4331 I would like to find a way to forward the HTTP port over to my iPhone through the USB cable so I can test on the device.

They key here is using the USB cable instead of a wireless network, as I am working in a very locked down environment where no wifi is available.

I want the iPhone to connect to the internet through the USB cable, so it would be using my Windows LAN connection and have the Windows localhost be visible to iPhone Safari.

Upvotes: 4

Views: 2947

Answers (2)

Siddharth Saraf
Siddharth Saraf

Reputation: 21

Follow these steps to see it working -

  1. Connect your iPhone to your PC via USB
  2. Find Tethering and Hotspot setting and enable "USB tethering" on your iPhone.
  3. When your PC has been successfully been connected to the internet, type "ipconfig" in the command prompt. Just copy the ipv4 address(along with port) and enter it on the browser with your localhost active
  4. If everything goes fine, then enter the same ipv4 address on your mobile(along with port) web browser.
  5. The server homepage will open on the iPhone.

I hope this helps.

Upvotes: 2

Jason
Jason

Reputation: 89117

I don't think you can do this. You either need to use WiFi, or have your server exposed on a public network that is accessible via your carrier. You might have some more options with a Jailbroken device.

Upvotes: 1

Related Questions