mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-27 20:03:45 +03:00
13 lines
377 B
JavaScript
Executable File
13 lines
377 B
JavaScript
Executable File
'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 )
|
|
};
|