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
If you've been exploring this, and a few of the external links, you will possibly find this answer:
https://stackoverflow.com/a/24770097/3842985
It is about a light-weigh DNS server called dnsmasq. Super simple, very powerful, and can be used in conjunction with your internal or external DNS servers.
Much easier than installing squid, fiddling with Apache, and other techniques that would be time-consuming, and risk the "integrity" of configurations, develop environments, test environments, etc.
Well worth considering.
I adopted that as a regular tool for development and for normal networking.
Nice tutorial to do so: http://egalo.com/2012/05/29/testing-mac-web-site-using-local-hostname-on-mobile-device/
An other way is to connect the IPad via Local Hotspot with my MAC OS X and establish an port-forwarding to the development VM. To achieve this I'v done the following Steps:
ssh -NL <IP-of-hotspot-host>:<source-port>:<url-to-local-vm>:80 <user-to-vm>
<IP-of-hotspot-host>:<source-port>
After created hotspot there is a WLAN-Point in
MAC OS X system settings >> Network >> WLAN
At my development-VM (Apache2) in /etc/apache2/sites-available/dkr.dev.local I had to add the following:
<VirtualHost *:80> ... ServerAlias <IP-of-hotspot-host> ... </VirtualHost>
I made it by using squidman on Mac. It's easy to set up and use.
I set it up in 5 minutes by following this article.
Update
Another thing is if you want to connect to the websites running on proxy server, in my case it's my Mac, you need to comment this line out in squidman->Preferences->Template
# protect web apps running on the proxy host from external users
# http_access deny to_localhost
I would try Relay Server (part of Afaria) which can re-direct mobile traffic based on profiles.
Update: tremoloqui's answer seems less trouble and far cheaper.
Internal DNS Server is one of the option but that was too cumbersome to implement. We tried installing squid as proxy server but that also didnt work because it was redirecting the URL to new server and this redirection was seen on browser URL too.
Thing which finally worked for us was to install Fiddler on one of the server and use this server as the proxy server on ipad. Fiddler also has a feature to map sub-domains to IP address i.e. something similar to /etc/hosts.
If you have a live website you can use for this:
You can add an A record to your DNS configuration: something.yourdomain.com which points to your local IP address, then add an entry for something.yourdomain.com to your virtual hosts file. Restart Apache, get your iOS device on the same network and you're good to go.