You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
513 B

8 years ago
var proxy = "HTTP 45.32.113.95:25; DIRECT";
8 years ago
var domains = {
8 years ago
"localhost": 1
8 years ago
};
var direct = 'DIRECT;';
var hasOwnProperty = Object.hasOwnProperty;
function FindProxyForURL(url, host) {
var suffix;
var pos = host.lastIndexOf('.');
while(1) {
suffix = host.substring(pos + 1);
if (hasOwnProperty.call(domains, suffix)) {
8 years ago
return proxy;
8 years ago
}
if (pos <= 0) {
break;
}
pos = host.lastIndexOf('.', pos - 1);
}
8 years ago
return proxy;
8 years ago
}