mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-19 05:30:06 +08:00
feat: add more jsDelivr mirrors
This commit is contained in:
parent
ee2e5c4e87
commit
cc8f110a30
@ -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())
|
||||
|
||||
@ -45,7 +45,11 @@ namespace Configs {
|
||||
enum Mirrors
|
||||
{
|
||||
GITHUB,
|
||||
JSDELIVR,
|
||||
CLOUDFLARE,
|
||||
GCORE,
|
||||
QUANTIL,
|
||||
FASTLY,
|
||||
CDN,
|
||||
};
|
||||
}
|
||||
} // namespace Configs
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -97,9 +97,6 @@
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="ruleset_mirror_l">
|
||||
<property name="toolTip">
|
||||
<string notr="true"><html><head/><body><p>Change will apply on next launch</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Remote Rule-set Mirror</string>
|
||||
</property>
|
||||
@ -114,7 +111,27 @@
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>jsDelivr</string>
|
||||
<string>jsDelivr(Cloudflare)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>jsDelivr(Gcore)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>jsDelivr(Quantil)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>jsDelivr(Fastly)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>jsDelivr(CDN)</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user