mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2026-01-03 09:49:04 +08:00
update domain strategy
This commit is contained in:
parent
69771e2080
commit
180a764977
@ -568,21 +568,8 @@ namespace NekoRay {
|
|||||||
status->result->outboundStats += ent->traffic_data;
|
status->result->outboundStats += ent->traffic_data;
|
||||||
|
|
||||||
if (IS_NEKO_BOX) {
|
if (IS_NEKO_BOX) {
|
||||||
auto ds = dataStore->outbound_domain_strategy;
|
// apply domain_strategy
|
||||||
if (status->forTest) {
|
outbound["domain_strategy"] = dataStore->outbound_domain_strategy;
|
||||||
ds = "";
|
|
||||||
} else if (ds == "UseIPv4") {
|
|
||||||
ds = "ipv4_only";
|
|
||||||
} else if (ds == "UseIPv6") {
|
|
||||||
ds = "ipv6_only";
|
|
||||||
} else if (ds == "PreferIPv4") {
|
|
||||||
ds = "prefer_ipv4";
|
|
||||||
} else if (ds == "PreferIPv6") {
|
|
||||||
ds = "prefer_ipv6";
|
|
||||||
} else {
|
|
||||||
ds = "";
|
|
||||||
}
|
|
||||||
outbound["domain_strategy"] = ds;
|
|
||||||
// TODO apply mux
|
// TODO apply mux
|
||||||
} else {
|
} else {
|
||||||
if (!status->forTest) outbound["domainStrategy"] = dataStore->outbound_domain_strategy;
|
if (!status->forTest) outbound["domainStrategy"] = dataStore->outbound_domain_strategy;
|
||||||
@ -655,6 +642,9 @@ namespace NekoRay {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
// apply domain_strategy
|
||||||
|
inboundObj["domain_strategy"] = dataStore->outbound_domain_strategy;
|
||||||
|
//
|
||||||
status->inbounds += inboundObj;
|
status->inbounds += inboundObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -18,12 +18,13 @@ namespace Preset {
|
|||||||
|
|
||||||
namespace SingBox {
|
namespace SingBox {
|
||||||
inline QStringList VpnImplementation = {"gvisor", "system"};
|
inline QStringList VpnImplementation = {"gvisor", "system"};
|
||||||
}
|
inline QStringList DomainStrategy = {"", "ipv4_only", "ipv6_only", "prefer_ipv4", "prefer_ipv6"};
|
||||||
|
} // namespace SingBox
|
||||||
|
|
||||||
namespace Windows {
|
namespace Windows {
|
||||||
inline QStringList system_proxy_format{"{ip}:{http_port}",
|
inline QStringList system_proxy_format{"{ip}:{http_port}",
|
||||||
"socks={ip}:{socks_port}",
|
"socks={ip}:{socks_port}",
|
||||||
"http={ip}:{http_port};https={ip}:{http_port};ftp={ip}:{http_port};socks={ip}:{socks_port}",
|
"http={ip}:{http_port};https={ip}:{http_port};ftp={ip}:{http_port};socks={ip}:{socks_port}",
|
||||||
"http=http://{ip}:{http_port};https=http://{ip}:{http_port}"};
|
"http=http://{ip}:{http_port};https=http://{ip}:{http_port}"};
|
||||||
}
|
} // namespace Windows
|
||||||
} // namespace Preset
|
} // namespace Preset
|
||||||
|
|||||||
@ -460,10 +460,6 @@
|
|||||||
<source>The sniffing result is used for destination</source>
|
<source>The sniffing result is used for destination</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>Outbound Domain Strategy</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Remote DNS</source>
|
<source>Remote DNS</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
@ -477,7 +473,7 @@
|
|||||||
<translation>فعال کردن مسیریابی DNS</translation>
|
<translation>فعال کردن مسیریابی DNS</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Domain Strategy</source>
|
<source>V2Ray Domain Strategy</source>
|
||||||
<translation>استراتژی دامنه</translation>
|
<translation>استراتژی دامنه</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
@ -568,6 +564,10 @@
|
|||||||
<source>Remote</source>
|
<source>Remote</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Inbound & Outbound Domain Strategy</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>DialogVPNSettings</name>
|
<name>DialogVPNSettings</name>
|
||||||
|
|||||||
@ -99,10 +99,6 @@
|
|||||||
<source>Use proxy when updating subscription</source>
|
<source>Use proxy when updating subscription</source>
|
||||||
<translation>更新订阅时使用代理</translation>
|
<translation>更新订阅时使用代理</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>Language</source>
|
|
||||||
<translation type="vanished">语言</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Security</source>
|
<source>Security</source>
|
||||||
<translation>安全</translation>
|
<translation>安全</translation>
|
||||||
@ -442,10 +438,6 @@
|
|||||||
<source>Routes</source>
|
<source>Routes</source>
|
||||||
<translation>路由</translation>
|
<translation>路由</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>Outbound Domain Strategy</source>
|
|
||||||
<translation>出站域名策略</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Disable</source>
|
<source>Disable</source>
|
||||||
<translation>禁用</translation>
|
<translation>禁用</translation>
|
||||||
@ -470,20 +462,12 @@
|
|||||||
<source>Remote DNS</source>
|
<source>Remote DNS</source>
|
||||||
<translation>远程 DNS</translation>
|
<translation>远程 DNS</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>Enhanced domain name resolution</source>
|
|
||||||
<translation type="vanished">增强域名解析</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Using multiple overseas DNS to query the server address can alleviate the DNS pollution of the server domain name to a certain extent, which may have side effects.</source>
|
|
||||||
<translation type="vanished">使用多个境外 DNS 查询服务器地址,一定程度上可缓解对服务器域名的 DNS 污染,可能有副作用。</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Enable DNS Routing</source>
|
<source>Enable DNS Routing</source>
|
||||||
<translation>启用 DNS 路由</translation>
|
<translation>启用 DNS 路由</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Domain Strategy</source>
|
<source>V2Ray Domain Strategy</source>
|
||||||
<translation>域名策略</translation>
|
<translation>域名策略</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
@ -574,6 +558,10 @@
|
|||||||
<source>Remote</source>
|
<source>Remote</source>
|
||||||
<translation>远程</translation>
|
<translation>远程</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Inbound & Outbound Domain Strategy</source>
|
||||||
|
<translation>出入站域名策略</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>DialogVPNSettings</name>
|
<name>DialogVPNSettings</name>
|
||||||
@ -1077,14 +1065,6 @@ https://matsuridayo.github.io/n-configuration/#vpn-tun</translation>
|
|||||||
<source>Destination</source>
|
<source>Destination</source>
|
||||||
<translation>目标地址</translation>
|
<translation>目标地址</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>End</source>
|
|
||||||
<translation type="vanished">结束</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Active</source>
|
|
||||||
<translation type="vanished">活动</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Start: %1
|
<source>Start: %1
|
||||||
End: %2</source>
|
End: %2</source>
|
||||||
@ -1308,10 +1288,6 @@ Split by line.</source>
|
|||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ProxyItem</name>
|
<name>ProxyItem</name>
|
||||||
<message>
|
|
||||||
<source>Remove</source>
|
|
||||||
<translation type="vanished">删除</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Confirmation</source>
|
<source>Confirmation</source>
|
||||||
<translation>确认</translation>
|
<translation>确认</translation>
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
#include "qv2ray/v2/ui/widgets/editors/w_JsonEditor.hpp"
|
#include "qv2ray/v2/ui/widgets/editors/w_JsonEditor.hpp"
|
||||||
#include "qv2ray/v3/components/GeositeReader/GeositeReader.hpp"
|
#include "qv2ray/v3/components/GeositeReader/GeositeReader.hpp"
|
||||||
#include "main/GuiUtils.hpp"
|
#include "main/GuiUtils.hpp"
|
||||||
|
#include "fmt/Preset.hpp"
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
@ -31,8 +32,10 @@ DialogManageRoutes::DialogManageRoutes(QWidget *parent) : QDialog(parent), ui(ne
|
|||||||
|
|
||||||
if (IS_NEKO_BOX) {
|
if (IS_NEKO_BOX) {
|
||||||
ui->domain_v2ray->setVisible(false);
|
ui->domain_v2ray->setVisible(false);
|
||||||
|
ui->outbound_domain_strategy->addItems(Preset::SingBox::DomainStrategy);
|
||||||
} else {
|
} else {
|
||||||
ui->domain_v2ray->setVisible(true);
|
ui->domain_v2ray->setVisible(true);
|
||||||
|
ui->outbound_domain_strategy->addItems({"AsIs", "UseIPv4", "UseIPv6", "PreferIPv4", "PreferIPv6"});
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
ui->sniffing_mode->setCurrentIndex(NekoRay::dataStore->sniffing_mode);
|
ui->sniffing_mode->setCurrentIndex(NekoRay::dataStore->sniffing_mode);
|
||||||
|
|||||||
@ -67,7 +67,7 @@
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Outbound Domain Strategy</string>
|
<string>Inbound & Outbound Domain Strategy</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -76,36 +76,6 @@
|
|||||||
<property name="editable">
|
<property name="editable">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">AsIs</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">UseIP</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">UseIPv4</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">UseIPv6</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">PreferIPv4</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">PreferIPv6</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@ -179,7 +149,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_6">
|
<widget class="QLabel" name="label_6">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Domain Strategy</string>
|
<string>V2Ray Domain Strategy</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
#include "./ui_mainwindow.h"
|
#include "./ui_mainwindow.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
||||||
|
#include "fmt/Preset.hpp"
|
||||||
#include "db/ProfileFilter.hpp"
|
#include "db/ProfileFilter.hpp"
|
||||||
#include "db/ConfigBuilder.hpp"
|
#include "db/ConfigBuilder.hpp"
|
||||||
#include "sub/GroupUpdater.hpp"
|
#include "sub/GroupUpdater.hpp"
|
||||||
@ -92,9 +93,13 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
|||||||
if (IS_NEKO_BOX) {
|
if (IS_NEKO_BOX) {
|
||||||
software_name = "NekoBox";
|
software_name = "NekoBox";
|
||||||
software_core_name = "sing-box";
|
software_core_name = "sing-box";
|
||||||
|
// replace default values
|
||||||
if (NekoRay::dataStore->log_level == "warning") {
|
if (NekoRay::dataStore->log_level == "warning") {
|
||||||
NekoRay::dataStore->log_level = "info";
|
NekoRay::dataStore->log_level = "info";
|
||||||
}
|
}
|
||||||
|
if (!Preset::SingBox::DomainStrategy.contains(NekoRay::dataStore->outbound_domain_strategy)) {
|
||||||
|
NekoRay::dataStore->outbound_domain_strategy = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// top bar
|
// top bar
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user