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.
来源:oschina
链接:https://my.oschina.net/u/196111/blog/346922