
Then use your trick to specify an SOCKS proxy in the file we just specified:Ĭhange permissions on proxy.pac to 777 (all can read, write, execute).ĭownload iTunnel for iTunes 9 (older versions are available too). Then add the following section afterwards: Proxiesįile:///private/var/preferences/proxy.pac private/var/preferences/SystemConfiguration/istįind the "ip1" section (if you want to replace GPRS/EDGE/3G interface) like: īe careful that you got the ip1 section if you want to override EDGE/3G! Do not look for the other Proxies entries in the file. The gist of the blog post is that you CAN control the proxy from the command line. This allows all my tcp-based apps to use an SSH server's internet across USB despite my WiFi being defective and not having a strong phone data plan (T-Mobile Prepaid). Together with this "SSH to get your iPhone online via USB cable" blog post, I came up with a pretty solid instant reverse SSH/SOCKS solution over USB tether given only an SSH server somewhere on your network. Now you can surf the web securely from your iPhone/iPod touch. Scroll to the bottom, click Auto and type in the address to your PAC file (e.g.
#Setup ssh proxy on iphone how to
If you're reading this chances are you know how to serve a file over HTTP on your work LAN, so I won't delve into that.įinally, on your iPhone/iPod Touch, go to Settings → Wi-Fi and click the blue arrow to the right of your work network.

Save the text file as a Proxy Auto-Config (PAC) file to a web accessible place with a. Replace the x's with your IP and the y's with the port you used after the -D in your SSH command ssh -N -g -D 1080 a text file and insert the following code: function FindProxyForURL(url, host)

Make sure the SOCKS tunnel on your work computer allows LAN connections so your iPhone/iPod Touch can connect to it. This is actually pretty easy to accomplish. Let's say, perhaps, that you are already forwarding your web traffic through an SSH/SOCKS tunnel at work (for privacy reasons) and you would like to use that same tunnel on your iPhone/iPod Touch.
#Setup ssh proxy on iphone code
Darn you Apple, is it so hard to put a SOCKS Proxy setting in the iPhone OS network settings panel?Īnyway, the best answer so far, and the only one I could find on the Net, is from a document from the SNIPPLR Code 2.0 website entitled How To Connect To A SOCKS Proxy From An Unjailbroken iPhone/iPod Touch.īelow is a cleaned up version of their solution: Well I guess, there's no better way to do it.
