mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2025-02-01 04:14:11 +03:00
21 lines
511 B
JavaScript
Executable File
21 lines
511 B
JavaScript
Executable File
'use strict';
|
|
|
|
module.exports = (hosts, ips, generator, generatePac) => {
|
|
|
|
function ifProxyByIp(host, blockedIpsArray) {
|
|
|
|
// Internet Explorer
|
|
if (!Array.prototype.indexOf)
|
|
Array.prototype.indexOf = function(obj, start) {
|
|
for (var i = (start || 0), j = this.length; i < j; i++)
|
|
if (this[i] === obj) return i;
|
|
return -1;
|
|
}
|
|
|
|
return blockedIpsArray.indexOf( dnsResolve(host) ) !== -1
|
|
}
|
|
|
|
return generatePac( ifProxyByIp, 'host', ips );
|
|
|
|
}
|