码迷,mamicode.com
首页 > 移动开发 > 详细

How to Configure iOS for iPhone and iPad to Use So

时间:2014-11-20 20:29:39      阅读:293      评论:0      收藏:0      [点我收藏+]

标签:style   http   io   ar   color   os   sp   for   on   

The socks proxy I created following Proxy Using SSH Tunnel works very well on both Linux and Windows. However, when I try to configure my iPhone and iPad with iOS, I find iOS does not support socks proxy in its settings interface. I don’t know why it is not added while socks proxy is indeed supported by the iOS operating system. This post introduces how to configure iOS to use the socks proxy created by the SSH tunnel.

Here, we assume that you have already set up one proxy (hence, you need one Linux or Unix host or others that you can set up SSH proxies listening on public IPs) that listens on an IP address which can be connected by the iOS device. One typical configuration may be that both the Linux host and the iOS device are connected to the same network such as as WLAN. Here, assume the address and the port of the socks proxy over SSH tunnel is proxy_host:proxy_port.

Prepare an PAC file on a host 

You need a Proxy Auto-Config (PAC) file to configure iOS to use the socks proxy. The PAC file is a text file that contains the content like this:

function FindProxyForURL(url, host)
{ 
     return "SOCKS proxy_host:proxy_port";
}

Here, you need to replace the proxy_host:proxy_port with your proxy setting.

Assume this PAC file is named proxy.pac and is stored at address http://www.my-server.com/proxy.pac.

Configure the iOS device to use the socks proxy 

Now, we can configure the iOS to use the socks proxy by pointing it to the PAC file.

In the iOS, go to Settings -> Wi-Fi and click the blue right arrow on the right of your wireless network, choose Auto in the HTTP Proxy section, and fill the URL of the PAC file (http://www.my-server.com/proxy.pac in our example).

By now, you have configured your iOS device to use the socks proxy over SSH tunnel. Check Who am I and you should already have been behind the proxy.


How to Configure iOS for iPhone and iPad to Use So

标签:style   http   io   ar   color   os   sp   for   on   

原文地址:http://my.oschina.net/sincoder/blog/346922

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!