How to use SOCKS proxy in an iOS device

As you may know, I’m one of the Apple’s fans and love to use my iOS gadgets (iPhone and iPad) in every type of tasks. Many of iOS users are using their iPhones/iPads in enterprise environments and want to connect to their company’s network while at work. In some cases, network administrators set a proxy server so users must connect to that proxy in order to access internal websites and more. As you know, iOS is currently supports HTTP proxy but it’s not enough for many users because their company’s network administrators set SOCKS proxy instead of HTTP!

By the time, there are some applications that can be installed in order to use SOCKS proxy in an iOS device but these apps are only available for jailbroken devices so other users can’t install them!

In this post I want to tell you how to use SOCKS proxy in an unjailbroken iOS device.

Note: In this example I’m using an iPhone to demonstrate the steps but you can use any iOS device; there’s no limitation at all!

The first thing you need is a web server (or any computer which has access to the internet). In this example my webserver is a PC with Windows 7 ultimate installed but you can use any type of web server you want. We use this web server in order to upload a .pac file!

The .pac file

A proxy auto-config (PAC) file defines how web browsers and other user agents can automatically choose the appropriate proxy server (access method) for fetching a given URL.

A PAC file contains a JavaScript function "FindProxyForURL(url, host)". This function returns a string with one or more access method specifications. These specifications cause the user agent to use a particular proxy server or to connect directly.

For more information about PAC files Click Here

Now you need to create a PAC file like the following:

function FindProxyForURL(url, host)
{
  return "SOCKS 192.168.0.1:3128";
}

After you’ve created the PAC file, upload it to your webserver.

Finally, you have to configure your iOS device. In the Setting app, tap on the Wi-Fi and then tap on the arrow in the right side of your selected access point:

WI-FI Networks

Then set HTTP proxy to “Auto” and then enter the URL of the PAC file you’ve uploaded to the webserver in the URL text box.

WI-FI Network Setttings

You’re done! Now you can access to your SOCKS proxy server!

If you have any question about this post, please leave your comments down below and I’ll answer them as soon as possible.

Hope it helps.