When I build sites I, like a fair few other Web Designers, use a local server setup. For me it's WAMP at the moment. In order to work on many peoples sites at once, not having to copy/paste or constantly rename things, I have to use a combination of the Windows hosts file, which is part of Windows and allows you to direct incoming traffic to various places. This is where I initially set up internal domain names like local.project.co.uk or local.clientproject.com and direct to 127.0.0.1, which is my local server that WAMP creates on install. Virtual Hosts is part of WAMP and takes the requests coming from the windows hosts file, giving them a tangible name and a place where the files for that site reside. Everything works beautifully so you can visit any of the domain names (local.project.co.uk, local.clientproject.com etc) you setup in your Windows hosts file in any browser just as if you are surfing the Web.
With the explosion of Mobile device popularity (including my beloved iPad), there is an ever growing need to open this flexible local development environment to these other devices on my local network. This subject has been one of my bugbears for years. It's a subject I have come back to & given up on time & time again. There are a raft of blog posts and forum discussions on this subject but no matter how much I tried, like most of these other people I couldn't get it to work. It seemed to be something to do with the iPad itself not being recognised by my local machine through the network.
That company who, in recent years have not really 'got' the Web have also released Adobe Shadow which allows you to install an app on each device you want to test your site on and in essence follows along whatever you do in the browser on your main machine. This little app was what inspired me to look into this issue again as it is the first glimmer of hope that Adobe might be starting to make new useful software.
Recently I had a collaborative breakthrough with a colleague at work by tracking down an issue with virtual hosts. By editing my httpd-vhosts.conf file and taking out all the directory permissions for local sites (which wasn't really needed but not obvious it was the issue). Suddenly, I was able to view the first site in the list but only by entering the IP address of my local machine in safari on the iPad.
It suddenly dawned on me at this point that the iPad was actually being seen by my local machine on the network but was simply being ignored by my WAMP server setup for some reason. Further investigation followed!
I'm not really an IT or programmery type by trade but I was recently reading about proxy servers, how they can direct traffic around, accept requests from other ip addresses, share connections and things like that. This got me thinking about this localhost situation. If I could use my local machine as an HTTP Proxy server, things might just work.
This software was made for my (and I'm guessing your) situation and simply worked without any configuration after I installed it. Just check the the default settings are the same as mine. Under Proxy -> Proxy Settings, you should see this in Windows:
The important thing here is the port number 8888, you need to enter this on your iPad as well as any other mobile devices you need to look at your local sites on. At his point you'll need your local machines IP address. Open up your command dialog by entering cmd under search in your start bar and enter ipconfig in the dialog, you should see something like this, the IP you need to note down is the one under 'Wireless LAN adapter Wireless Network Connection', I've blanked mine out as that might confuse you:
Next, go to your iPad (I'd guess the iPhone is very similar) and under settings, select your Wireless connection making sure it's the same as your local machine. Add the proxy settings as per below, including the ip address you just noted down as the server and 8888 under port number:
Once you have done this, go to safari on the iPad, or whatever other browser you use and try typing in a local address (yes, a local address!). As soon as you do this, your local machine should let out an almightly 'warning' alert like the one below. Guess what you need to do?!
Once you have accepted the connection, go back to your iPad and try one of your local sites.
No need to thank me (but it'd be nice if you did)!