mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-28 04:13:43 +03:00
13 lines
377 B
JavaScript
13 lines
377 B
JavaScript
|
'use strict';
|
||
|
|
||
|
module.exports = (hosts, ips, generator, generatePac) => {
|
||
|
var hostsHash = {'': true};
|
||
|
hosts.forEach( host => hostsHash[host] = true );
|
||
|
function ifProxyByHash(host, hostsHash) {
|
||
|
while(!hostsHash[host])
|
||
|
host = (host+'.').replace(/^\w*\./g);
|
||
|
return host.length !== 0;
|
||
|
}
|
||
|
return generatePac( ifProxyByHash, 'host', hostsHash )
|
||
|
};
|