我正在使用没有 GUI 的无头 ubuntu 系统。我想为我的 ubuntu 使用基于pac 的代理。我也想在 deluge bittorent 客户端上使用它
我目前正在使用此设置
gsettings set org.gnome.system.proxy mode 'manual'
gsettings set org.gnome.system.proxy.http enabled true
gsettings set org.gnome.system.proxy.http host 'http://localhost/proxy.pac'
这是我的 .pac 文件的内容:
function isPlainHostNameEx(host){
return !(!!~host.indexOf('.') || !!~host.indexOf(':'));
}
function FindProxyForURL(url, host){
var lhost = host.toLowerCase();
host = lhost;
IPNotation = /^\d+\.\d+\.\d+\.\d+$/g;
var direct = [
"local", "dev", "ip", "box", "lvh.me", "ripe", "invalid",
"intra", "intranet", "onion", "vcap.me", "127.0.0.1.xip.io",
"smackaho.st", "localtest.me", "site", "ip"
]
for(var i=0;i<direct.length;i++){
if(dnsDomainIs(host, direct[i])){
return "DIRECT";
}
}
var CC = "DE";
var exceptions = JSON.parse('[{"CC":"US"}]');
for(var i=0;i<exceptions.length;i++){
var e = exceptions[i];
if(e.CC == CC) {
for(var j=0;j<e.domains.length;j++){
if(dnsDomainIs(host, e.domains[j])){
return e.nodes;
}
}
}
}
return "12.024.04.10"
}
当我运行时,apt-get update
我得到这些错误:
W: Failed to fetch http://stingray.cyber.net.pk/pub/ubuntu/dists/trusty-proposed/Release.gpg Could not resolve 'stingray.cyber.net.pk'
我能做些什么来解决这个问题?