Since on an iPad we cannot edit the hosts file (without jailbreaking), how can we arbitrarily redirect web traffic to another url?
This would be important for someth
Here is a no configuration method for cross device/computer testing of a Mamp Pro Virtual host. The only limitation is you can only test one domain at a time, but for me this is fine when I'm developing. It is really simple however to change between virtual hosts directly in mamp.
Im running mamp pro 2, mountain lion. My sites folder contains the individual domain folders.
I found if you choose the specific ip of the local computer under the virtual host 'ip /port' and restart mamp this domain will become the default domain when viewing the localhost computers' ip address, or computer name, across the network.
For testing purposes this works great across all devices on the network, including the iPad. If you want to test another virtual host you can simply return the ip/port config to "*" and then reassign another domain to the computers ip address and restart.
The advantage of this simple approach is you can provide access to clients directly to your development sites when your on the same network without having to go through any configuration on their machine.
Hope this helps anyone else looking for simple solution.
The way to get around this limitation of the iPad is to use a HTTP proxy server, such as Squid running on another machine where you can edit the hosts file.
On the iPad Under Settings -> Network -> Wi-Fi -> (Your network) There is a HTTP Proxy setting which can be set to manual. Enter you proxy information here.
Once this is set up you would be able to manipulate the iPad as if you were changing the hosts file.
Answers herein are correct. A bit more knowledge: These will not work with cert pinning. What you can do is either (1) use a domain wildcard cert to support your dev/test/qa region testing. And/or (2) use a reverse proxy server such as Apache whereby you change to where Apache routes the requests within your network. Now, when you get into SSL Pinning testing then you are dead in the water with the physical devices and can only validate with simulator (ios) and emulator (android).
Using custom DNS server on PC can solve this. I'm using and working perfectly.
Check https://technitium.com/dns/ to download custom DNS server. Which is built using .Net technology. After configuring this tool, you need to change DNS setting to custom and set IP of your PC. To avoid changing IP every time when you restart PC, use static IP on PC.
Setup the hosts file on a computer running a proxy server such as Fiddler or Charles, and configure the iPad to use that computer as an HTTP proxy.
Here are instructions for how to do this with Fiddler: http://conceptdev.blogspot.com/2009/01/monitoring-iphone-web-traffic-with.html
And this is for Charles: http://www.ravelrumba.com/blog/ipad-http-debugging/
I need to test web apps I am developing on an iPad. I use Apache on my dev machine to run the web apps, so the easiest solution I found was to use Apache mod_proxy.
My dev machine is visible on my home network as sapphire.local.
The web app I am testing is at hosted on the dev machine at demo.cms.dev (I am using POW).
To setup the proxy, I added the following section to httpd.conf.
<VirtualHost *:80>
ServerName sapphire.local
ProxyPass / http://demo.cms.dev/
ProxyPassReverse / http://demo.cms.dev/
ProxyPassReverseCookieDomain .cms.dev .sapphire.local
ProxyPreserveHost Off
</VirtualHost>
This routes incoming requests on sapphire.local to demo.cms.dev. The method only works for one app at a time. I think you could use different ports to setup additional apps. Maybe someone has a better solution?