I have a situation where a user has an iphone and a macbook. The macbook uses a SOCKS proxy via ssh to access some internal webpages. Is is possible for either the iPhone to do the same, or can the macbook 'share' the proxy? Is a VPN from the macbook the answer? and if so where would I start?

  • Looks like a question that falls into the "interfacing with your computer" exception to the electronic devices rule and is therefore on topic.
    – Daniel Beck
    Nov 20 '11 at 22:50

Pretty straightforward; I was trying to do this myself.

Assuming you have an ssh host already set up, use:

ssh -D 9999 user@domain.com

You may have to use ssh -N -g -D 9999 user@domain.com, but just -D worked for me.

Once you have the ssh tunnel going, you'll need to serve a proxy configuration file with your local webserver to use your SOCKS proxy as an http proxy.

Go to your ~/Sites/ directory, and create a Proxy Auto-Config (PAC) file (eg proxy.pac). It should have the following:

function FindProxyForURL(url, host) {
   return "SOCKS 192.168.xx.xx:yyyy";

Then, enable internet sharing and web sharing in Mac Preferences (you can enable basic WEP security from the Airport Options button).


On your iPhone, join your ad-hoc network, go to Settings > Wifi and click the blue arrow to the right of your network, scroll to the bottom, click Auto and type in the address to your PAC file (e.g. http://192.168.xx.xx/mysupersecretproxy.pac).

Sources: http://snipplr.com/view/16563/how-to-connect-to-a-socks-proxy-from-an-unjailbroken-iphoneipod-touch/

and http://macs.about.com/od/networking/qt/websharing.htm (referenced in the first article)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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