iPhone配置socks代理

服务器端设置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[root@localhost ~]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.25 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::215:5dff:fe01:1106 prefixlen 64 scopeid 0x20<link>
ether 00:15:5d:01:11:06 txqueuelen 1000 (Ethernet)
RX packets 8981591 bytes 5389285998 (5.0 GiB)
RX errors 0 dropped 58 overruns 0 frame 0
TX packets 1369788 bytes 1311502278 (1.2 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 407818 bytes 117744700 (112.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 407818 bytes 117744700 (112.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

[root@localhost ~]#
1
[root@localhost ~]# ssh -D 9527 -fgN -i id_rsa opc@180.223.1.189

代理文件配置

代理自动配置(Proxy auto-config,简称PAC)是一种网页浏览器技术,用于定义浏览器该如何自动选择适当的代理服务器来访问一个网址。

1
2
3
function FindProxyForURL(url, host) {
return "SOCKS 192.168.1.25:9527";
}

以上三行代码保存为proxy.pac文件,放到http服务器。

1
2
3
4
5
6
7
8
DIRECT
直接连接,不使用代理

PROXY host:port
   使用指定的http代理

SOCKS host:port
   使用指定的SOCKS代理

手机终端设置

1
设置-无线局域网-右侧感叹号-配置代理-自动-URL-http://192.168.1.203/proxy.pac-存储