Posted By

shaunchapman on 07/01/09


howto iphone proxy ipod touch socks

Versions (?)

Who likes this?

2 people have marked this snippet as a favorite


How To Connect To A SOCKS Proxy From An Unjailbroken iPhone/iPod Touch

 / Published in: JavaScript

Let's say, perhaps, that you are already forwarding your web traffic through an SSH/SOCKS tunnel at work (for privacy reasons that have absolutely no relation to accessing blocked sites LOL!) and you would like to use that same tunnel on your iPhone/iPod Touch. This is actually pretty easy to accomplish.

First, you need to make sure the SOCKS tunnel on your work computer allows LAN connections so your iPhone/iPod Touch can connect to it. To do this, you simply need to add -g to your existing SSH command (something like ssh -N -g -D 1080 [email protected]).

Most people think you can't connect to a SOCKS proxy from an iPhone/iPod Touch without jailbreaking it but the truth is you can. You simply have to create a Proxy Auto-Config (PAC) file, insert the function below in it (replace the x's with your IP and the y's with the port you used after the -D in your SSH command), and save it to a web accessible place with a .pac extension. 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.

Finally, on your iPhone/iPod Touch, go to Settings > Wifi and click the blue arrow to the right of your work 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).

Congrats! Now you can surf the web securely from your iPhone/iPod touch ;)

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

Report this snippet  


RSS Icon Subscribe to comments
Posted By: Thireus on March 14, 2010

iPhone + SSH Tunnel + Socks Proxy = SUCCESS Very Happy


Thanks for the help :) I'm now able to use my local socks proxy via Wifi/3G/Edge :p and I also created a script that recreate the tunnel if the connexion has been lost ;)

Posted By: alibozorgkhan on April 12, 2010

Hi I have created my socks proxy on localhost and port 1080. I put return "SOCKS" in my function and I created the pac file and put it in /usr/users/alibozorgkhan/library. I can put my internet connection behind my socks proxy in my laptop but when I share my lan connection via wireless, my Ipod is not behind it. I set proxy "http://mysharedwirelessip(" but still I don't have proxy on my ipod. What should I do? thanx alot

Posted By: the_coder on May 4, 2010


Read this:

Posted By: StarChip on July 22, 2010

Any chance a modification of this would allow a iPxd with wifi to connect to a iPhone with the latest Handy Light app that allows tethering?

Posted By: ProfChaos on December 4, 2013

Thanks for this great post. However, it seems that the DNS lookup will still be done on the client, that can cause some problems. How can I set the DNS lookup to be performed on the proxy server too? Many thanks!

Posted By: Jacky888 on August 2, 2018

kyocera hydro life c6530n firmware gofirmware

You need to login to post a comment.