mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-23 18:10:34 +08:00
feat: add more jsDelivr mirrors
This commit is contained in:
parent
ee2e5c4e87
commit
cc8f110a30
@ -76,8 +76,16 @@ namespace Configs {
|
|||||||
if(auto url = QUrl(link); url.isValid() && url.host() == "raw.githubusercontent.com")
|
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;
|
int index = 0;
|
||||||
QString result = "https://cdn.jsdelivr.net/gh";
|
|
||||||
foreach(QString item, list)
|
foreach(QString item, list)
|
||||||
{
|
{
|
||||||
if(!item.isEmpty())
|
if(!item.isEmpty())
|
||||||
|
|||||||
@ -45,7 +45,11 @@ namespace Configs {
|
|||||||
enum Mirrors
|
enum Mirrors
|
||||||
{
|
{
|
||||||
GITHUB,
|
GITHUB,
|
||||||
JSDELIVR,
|
CLOUDFLARE,
|
||||||
|
GCORE,
|
||||||
|
QUANTIL,
|
||||||
|
FASTLY,
|
||||||
|
CDN,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
} // namespace Configs
|
} // namespace Configs
|
||||||
|
|||||||
@ -24,7 +24,7 @@ namespace Configs {
|
|||||||
QString domain_strategy = "AsIs";
|
QString domain_strategy = "AsIs";
|
||||||
QString outbound_domain_strategy = "AsIs";
|
QString outbound_domain_strategy = "AsIs";
|
||||||
int sniffing_mode = SniffingMode::FOR_ROUTING;
|
int sniffing_mode = SniffingMode::FOR_ROUTING;
|
||||||
int ruleset_mirror = Mirrors::JSDELIVR;
|
int ruleset_mirror = Mirrors::CLOUDFLARE;
|
||||||
|
|
||||||
explicit Routing(int preset = 0);
|
explicit Routing(int preset = 0);
|
||||||
|
|
||||||
|
|||||||
@ -97,9 +97,6 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QLabel" name="ruleset_mirror_l">
|
<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">
|
<property name="text">
|
||||||
<string>Remote Rule-set Mirror</string>
|
<string>Remote Rule-set Mirror</string>
|
||||||
</property>
|
</property>
|
||||||
@ -114,7 +111,27 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<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>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user