socks proxy
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.
我在使用SSH隧道的代理之后创建的袜子代理在Linux和Windows上均能很好地工作。 但是,当我尝试使用iOS配置iPhone和iPad时,我发现iOS在其设置界面中不支持袜子代理。 我不知道为什么在iOS操作系统确实支持socks proxy的情况下不添加它。 这篇文章介绍了如何配置iOS以使用SSH隧道创建的socks代理。
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 WiFi network which you iOS device is connected to. Here, assume the address and the port of the socks proxy over SSH tunnel is proxy_host:proxy_port
. In summary, what you need are
在这里,我们假设您已经设置了一个代理(因此,您需要一个Linux或Unix主机或其他可以设置用于侦听公共IP的SSH代理的代理),该代理侦听可以由iOS设备连接的IP地址。 一种典型的配置可能是Linux主机和iOS设备都连接到与iOS设备连接的同一个WiFi 网络 。 在这里,假设通过SSH隧道的袜子代理的地址和端口是proxy_host:proxy_port
。 总而言之,您需要的是
You need additional hosts and configurations. The benefit is that the proxy provided by the Linux/Unix host is very solid and stable.
您需要其他主机和配置。 好处是Linux / Unix主机提供的代理非常可靠和稳定。
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:
您需要一个代理自动配置(PAC)文件来配置iOS以使用袜子代理。 PAC文件是一个文本文件,其中包含以下内容:
function FindProxyForURL(url, host)
{
return "SOCKS proxy_host:proxy_port";
}
Here, you need to replace the proxy_host:proxy_port
with your proxy setting.
在这里,您需要使用代理设置替换proxy_host:proxy_port
。
You will need a Web server to host the PAC file. One in your local network or one connected to the Internet are both fine. There are many options to do this. You may set up your own web server, use Dropbox, choose a shared hosting server or use github.
您将需要一个Web服务器来托管PAC文件。 局域网中的一个或连接到Internet的一个都可以。 有很多选项可以做到这一点。 您可以设置自己的Web服务器,使用Dropbox ,选择共享托管服务器或使用github 。
Here, in this tutorial, we assume this PAC file is named proxy.pac
and is stored at address http://www.my-server.com/proxy.pac
.
在此,在本教程中,我们假定此PAC文件名为proxy.pac
,并存储在地址http://www.my-server.com/proxy.pac
。
Now, we can configure the iOS to use the socks proxy by pointing it to the PAC file.
现在,我们可以通过将iOS代理指向PAC文件来配置它使用袜子代理。
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).
在iOS中,转到“设置” ->“ Wi-Fi” ,然后单击无线网络右侧的蓝色右箭头,在“ HTTP代理”部分中选择“ 自动 ”,然后填写PAC文件的URL( http://www.my-server.com/proxy.pac
在我们的示例中为http://www.my-server.com/proxy.pac
)。
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.
到目前为止,您已将iOS设备配置为通过SSH隧道使用socks代理。 检查我是谁 ,您应该已经位于代理之后。
socks proxy