vfarid / v2ray-worker-sub

A Cloudflare's Worker script to gather free v2ray configs and mix them with worker in order to make them work over filtered networks.
GNU General Public License v3.0
715 stars 299 forks source link

add domain resolve support & solve cpu time limit issue #4

Closed Nalbekink closed 1 year ago

Nalbekink commented 1 year ago
  1. Enhanced Domain Name Resolution: The proposed changes introduce an option to optimize the system's ability to resolve domain names to IPs.
  2. Enhanced Algorithm for Sample Selection: The current algorithm for selecting k random samples from a large array has a time complexity of O(n^2), which can be computationally expensive. The proposed changes implement an optimized algorithm with a time complexity of O(k), resulting in faster and more streamlined sample selection.
  3. Streamlined Processing of VMESS Configs: The proposed changes modify the existing approach to process VMESS configs. Rather than processing the entire set of configs and then selecting k samples, the new approach takes k random samples and processes them individually. This updated approach significantly improves efficiency and reduces processing time.
vfarid commented 1 year ago

Thank you, but there are some reasons prevent merging your pull request:

  1. There were no reason to change the coding style
  2. Resolving subdomain to ip could be done by clients and it is recommended because clean ip subdomains are dynamic, not static. So if we resolve subdomain to ip in subscription links, changing/updating clean ip subdomains will be ignored by the code.
  3. For those who use original configs, existance of shadowsocks and trojan configs are useful, so no reason to remove that part of code.

For the future, please implement each seperate feature in a seperate pull request so i can merge each part seperately.

Thank you