diff --git a/include/configs/ConfigBuilder.hpp b/include/configs/ConfigBuilder.hpp index 8839202..748c00b 100644 --- a/include/configs/ConfigBuilder.hpp +++ b/include/configs/ConfigBuilder.hpp @@ -75,9 +75,17 @@ namespace Configs { return link; if(auto url = QUrl(link); url.isValid() && url.host() == "raw.githubusercontent.com") { - QStringList list = url.path().split('/'); + QStringList list = url.path().split('/'); + QString result; + switch(dataStore->routing->ruleset_mirror) { + case Mirrors::GCORE: result = "https://gcore.jsdelivr.net/gh"; break; + case Mirrors::QUANTIL: result = "https://quantil.jsdelivr.net/gh"; break; + case Mirrors::FASTLY: result = "https://fastly.jsdelivr.net/gh"; break; + case Mirrors::CDN: result = "https://cdn.jsdelivr.net/gh"; break; + default: result = "https://testingcf.jsdelivr.net/gh"; + } + int index = 0; - QString result = "https://cdn.jsdelivr.net/gh"; foreach(QString item, list) { if(!item.isEmpty()) diff --git a/include/global/Const.hpp b/include/global/Const.hpp index abff0c4..20d6861 100644 --- a/include/global/Const.hpp +++ b/include/global/Const.hpp @@ -45,7 +45,11 @@ namespace Configs { enum Mirrors { GITHUB, - JSDELIVR, + CLOUDFLARE, + GCORE, + QUANTIL, + FASTLY, + CDN, }; } } // namespace Configs diff --git a/include/global/DataStore.hpp b/include/global/DataStore.hpp index bd9fb4d..ad6c085 100644 --- a/include/global/DataStore.hpp +++ b/include/global/DataStore.hpp @@ -24,7 +24,7 @@ namespace Configs { QString domain_strategy = "AsIs"; QString outbound_domain_strategy = "AsIs"; int sniffing_mode = SniffingMode::FOR_ROUTING; - int ruleset_mirror = Mirrors::JSDELIVR; + int ruleset_mirror = Mirrors::CLOUDFLARE; explicit Routing(int preset = 0); diff --git a/include/ui/setting/dialog_manage_routes.ui b/include/ui/setting/dialog_manage_routes.ui index 5eeb766..1b28b0e 100644 --- a/include/ui/setting/dialog_manage_routes.ui +++ b/include/ui/setting/dialog_manage_routes.ui @@ -97,9 +97,6 @@ - - <html><head/><body><p>Change will apply on next launch</p></body></html> - Remote Rule-set Mirror @@ -114,7 +111,27 @@ - jsDelivr + jsDelivr(Cloudflare) + + + + + jsDelivr(Gcore) + + + + + jsDelivr(Quantil) + + + + + jsDelivr(Fastly) + + + + + jsDelivr(CDN)