6
I'd like to be a man-in-the-middle between my iPhone and the internet for debugging purposes. In particular, I'd like to convince my iPhone that a particular host on the internet is my local development machine, and that it should not actually connect out to the net (so the app believes it's contacting a production server when in fact it's hitting a local box).
I can disable 3G and use my Mac's ad-hoc WiFi, but adding /etc/hosts
entries of course won't route requests to the local machine, since it's just doing NAT, not handling DNS or other protocols on behalf of the phone.
The only thing I can think of is to jailbreak it and mess with the hosts file on the device, but I'd rather not do that if I can avoid it. Can anyone think of another way of going about this?
Future readers: Set a HTTP proxy in your iPhone's network settings, using your Mac's IP. And on your Mac, install and run mitmproxy. There's a good guide here: http://www.shubhro.com/2014/12/18/reverse-engineering-kayak-mitmproxy/
– Collin Allen – 2015-10-21T20:34:24.847