2017-04-18 34 views
0

無法找到關於我的問題的確切答案。我想知道是否有可能毒害pac文件指向環回地址,以便流量消失。似乎我指向127.0.0.1的流量仍然在進入代理。想知道我是否做錯了,如果我需要把「返回代理127.0.0.1」。PAC文件返回選項往localhost

我想對迴環中毒這個原因是因爲流量被阻塞,但降低了我的代理的CPU利用率我想讓這個流量在本地(在計算機上)消失,因爲它在代理上一直被拒絕。造成高CPU。

function FindProxyForURL (url , host){ 

//General exception from a more general rule 
if (isPlainHostName(host)) return "DIRECT"; 

//Localhost 
else if (shExpMatch(host, "test.example.com")) return "127.0.0.1"; 
} 

回答

0

是塊返回字符串需要以「PROXY」開頭,它也應該有一個端口號。

我一般使用這樣的框架:

var ALLOW = "DIRECT"; 
var BLOCK = "PROXY 127.0.0.1:65535"; 


function FindProxyForURL(url, host) 
{ 
    if (dnsDomainIs(host,"example.org")) return BLOCK; 
    return ALLOW; 
}