Pac文件

来自三线的随记

js语法

主体函数 function FindProxyForURL(url,host) 

direct:直接连接

proxy IP:PORT

socket IP:PORT

返回结果大小写不敏感

Example:

/*
VM子网 
192.168.226.0/24
192.168.168.0/24
*/

function FindProxyForURL(url,host) {
if(isPlainHostName(host) || isInNet(host,"127.0.0.0","255.255.255.0")||isInNet(host,"192.168.226.0","255.255.255.0")||isInNet(host,"192.168.168.0","255.255.255.0")){
return "DIRCT";
}else
return "PROXY 127.0.0.1:1088";
}

更多解释 [1]