vitaliylag / GenPAC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running

node gen_array
node gen_array --help
node gen_binSearch_strings_good

Full steps

  1. git clone https://github.com/vitaliylag/GenPAC.git
  2. cd <created_dir>
  3. Use commands listed above.
  • Resulting files will be created in "output-js" and "output-pac" directories.
  • You should have node.js installed.

Description

This scripts generate PAC file from hosts and ips files. All specified hosts and ips will be proxied, all other hosts and ips will not be proxied.

Scripts support:

  • Skipping the same enries
  • Dropping "*." ("good" versions of scripts always check subdomains, other scripts never do that)
  • Dropping start and end dots
  • Dropping last dot in FindProxyForURL

Scripts do not support:

  • Converting non-unicode characters
  • Using URLs as input

Difference between scripts

There is few scripts generating PAC files. Resulting PAC files do the same things but in difference ways so they have different performance. You can choose generator that makes PAC file with best performance.

  • gen_array.js just loops over array
  • gen_array2.js the same but without functions and breaking loops
  • gen_globalObject.js using global object as hashmap
  • gen_binSearch_array.js bin-search over array
  • gen_binSearch_strings.js bin-search over string
  • gen_binSearch_strings_good.js the same but checks subdomains. All subdomains of every host specified in hosts will be proxied. For optimizations:
    1. Top-level domain is not checked because it is unlikely that some top-level zone will be in the list. If you add "com" or "org" entry into hosts file, "*.com" and "*.org" will not be proxied. But if you add "example.com", "*.example.com" will be proxied.
    2. Level number is limited by 5. If some hosts have more than 5 levels, other levels will be dropped, so all subdomains will be proxied. Example: 7.6.5.4.3.example.com will be saved as 5.4.3.example.com so "*.5.4.3.example.com" will be proxied.

Actually "gen_binSearch_strings_good.js" generator is recommended.

Benchmark

You can benchmark any PAC files (not only created by this generators).

Running

node --expose-gc bench PATH
node --expose-gc --noopt --no-always-opt bench PATH

Example: node --expose-gc bench output-js/array.js

Full steps

  1. git clone https://github.com/vitaliylag/GenPAC.git
  2. cd <created_dir>
  3. Use commands listed above.

About

License:Other


Languages

Language:JavaScript 100.0%