Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Would it be possible for me to proxy example.com to http://google.com/example.com/, through my jailbroken iPhone? I would tether my connection to my laptop, so to my laptop it connects to Google's IP address, but my phone then rewrites it to the actual destination.

On my computer (connected to my iPhone's connection), I type http://google.com/yahoo.com/

My iPhone connects to yahoo.com, gets the contents, and sends it back to my computer.

To my computer, it appears I've being connecting to google.com, but I'm actually connected to yahoo.

One way I think it might work is to run a web server with mod_rewrite on my iPhone and a simple php include script, but I'll have to be able to make my web server respond to google.com. Another tack might be to run a custom DNS service on the iPhone. Has anyone taken what seems plausible in theory and accomplished it in practice?

share|improve this question

migrated from superuser.com Aug 7 '12 at 21:59

This question came from our site for computer enthusiasts and power users.

1 Answer 1

Why not just edit the hosts file on the laptop? Unless you don't own the laptop...

Another option here is to have your iPhone connect via a proxy. Here's an example of how to do it with Fiddler.

In that case any dns lookups your iPhone does will use the hosts file of the machine Fiddler is running on.

share|improve this answer
    
Hmm, it's not just DNS lookups / hosts, it's the entire connection including the IP / URL –  gladoscc Aug 7 '12 at 22:52
    
So you want your iPhone to act as a DNS server for ONLY one domain name? There is no software that turns your jailbroken iPhone into a DNS server, even for only one domain name. What you asked to do is possible with the directions I gave. Turning your iPhone into a DNS server, not so much. –  Everett Aug 7 '12 at 22:57
    
Sorry, but I don't think you're understanding me - I want to modify the destination on my phone. I've updated my question with more info. –  gladoscc Aug 8 '12 at 0:23
    
You are trying to ice skate uphill to do this. Why not just edit the hosts file on the laptop? –  Everett Aug 8 '12 at 3:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.