mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-19 05:30:06 +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;
|
||||
|
||||
if (IS_NEKO_BOX) {
|
||||
auto ds = dataStore->outbound_domain_strategy;
|
||||
if (status->forTest) {
|
||||
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;
|
||||
// apply domain_strategy
|
||||
outbound["domain_strategy"] = dataStore->outbound_domain_strategy;
|
||||
// TODO apply mux
|
||||
} else {
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@ -18,12 +18,13 @@ namespace Preset {
|
||||
|
||||
namespace SingBox {
|
||||
inline QStringList VpnImplementation = {"gvisor", "system"};
|
||||
}
|
||||
inline QStringList DomainStrategy = {"", "ipv4_only", "ipv6_only", "prefer_ipv4", "prefer_ipv6"};
|
||||
} // namespace SingBox
|
||||
|
||||
namespace Windows {
|
||||
inline QStringList system_proxy_format{"{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}"};
|
||||
}
|
||||
} // namespace Windows
|
||||
} // namespace Preset
|
||||
|
||||
@ -460,10 +460,6 @@
|
||||
<source>The sniffing result is used for destination</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Outbound Domain Strategy</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remote DNS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@ -477,7 +473,7 @@
|
||||
<translation>فعال کردن مسیریابی DNS</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Domain Strategy</source>
|
||||
<source>V2Ray Domain Strategy</source>
|
||||
<translation>استراتژی دامنه</translation>
|
||||
</message>
|
||||
<message>
|
||||
@ -568,6 +564,10 @@
|
||||
<source>Remote</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Inbound & Outbound Domain Strategy</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DialogVPNSettings</name>
|
||||
|
||||
@ -99,10 +99,6 @@
|
||||
<source>Use proxy when updating subscription</source>
|
||||
<translation>更新订阅时使用代理</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Language</source>
|
||||
<translation type="vanished">语言</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Security</source>
|
||||
<translation>安全</translation>
|
||||
@ -442,10 +438,6 @@
|
||||
<source>Routes</source>
|
||||
<translation>路由</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Outbound Domain Strategy</source>
|
||||
<translation>出站域名策略</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable</source>
|
||||
<translation>禁用</translation>
|
||||
@ -470,20 +462,12 @@
|
||||
<source>Remote DNS</source>
|
||||
<translation>远程 DNS</translation>
|
||||
</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>
|
||||
<source>Enable DNS Routing</source>
|
||||
<translation>启用 DNS 路由</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Domain Strategy</source>
|
||||
<source>V2Ray Domain Strategy</source>
|
||||
<translation>域名策略</translation>
|
||||
</message>
|
||||
<message>
|
||||
@ -574,6 +558,10 @@
|
||||
<source>Remote</source>
|
||||
<translation>远程</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Inbound & Outbound Domain Strategy</source>
|
||||
<translation>出入站域名策略</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DialogVPNSettings</name>
|
||||
@ -1077,14 +1065,6 @@ https://matsuridayo.github.io/n-configuration/#vpn-tun</translation>
|
||||
<source>Destination</source>
|
||||
<translation>目标地址</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>End</source>
|
||||
<translation type="vanished">结束</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Active</source>
|
||||
<translation type="vanished">活动</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Start: %1
|
||||
End: %2</source>
|
||||
@ -1308,10 +1288,6 @@ Split by line.</source>
|
||||
</context>
|
||||
<context>
|
||||
<name>ProxyItem</name>
|
||||
<message>
|
||||
<source>Remove</source>
|
||||
<translation type="vanished">删除</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Confirmation</source>
|
||||
<translation>确认</translation>
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
#include "qv2ray/v2/ui/widgets/editors/w_JsonEditor.hpp"
|
||||
#include "qv2ray/v3/components/GeositeReader/GeositeReader.hpp"
|
||||
#include "main/GuiUtils.hpp"
|
||||
#include "fmt/Preset.hpp"
|
||||
|
||||
#include <QFile>
|
||||
#include <QMessageBox>
|
||||
@ -31,8 +32,10 @@ DialogManageRoutes::DialogManageRoutes(QWidget *parent) : QDialog(parent), ui(ne
|
||||
|
||||
if (IS_NEKO_BOX) {
|
||||
ui->domain_v2ray->setVisible(false);
|
||||
ui->outbound_domain_strategy->addItems(Preset::SingBox::DomainStrategy);
|
||||
} else {
|
||||
ui->domain_v2ray->setVisible(true);
|
||||
ui->outbound_domain_strategy->addItems({"AsIs", "UseIPv4", "UseIPv6", "PreferIPv4", "PreferIPv6"});
|
||||
}
|
||||
//
|
||||
ui->sniffing_mode->setCurrentIndex(NekoRay::dataStore->sniffing_mode);
|
||||
|
||||
@ -67,7 +67,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Outbound Domain Strategy</string>
|
||||
<string>Inbound & Outbound Domain Strategy</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -76,36 +76,6 @@
|
||||
<property name="editable">
|
||||
<bool>false</bool>
|
||||
</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>
|
||||
</item>
|
||||
</layout>
|
||||
@ -179,7 +149,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Domain Strategy</string>
|
||||
<string>V2Ray Domain Strategy</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#include "./ui_mainwindow.h"
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include "fmt/Preset.hpp"
|
||||
#include "db/ProfileFilter.hpp"
|
||||
#include "db/ConfigBuilder.hpp"
|
||||
#include "sub/GroupUpdater.hpp"
|
||||
@ -92,9 +93,13 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
||||
if (IS_NEKO_BOX) {
|
||||
software_name = "NekoBox";
|
||||
software_core_name = "sing-box";
|
||||
// replace default values
|
||||
if (NekoRay::dataStore->log_level == "warning") {
|
||||
NekoRay::dataStore->log_level = "info";
|
||||
}
|
||||
if (!Preset::SingBox::DomainStrategy.contains(NekoRay::dataStore->outbound_domain_strategy)) {
|
||||
NekoRay::dataStore->outbound_domain_strategy = "";
|
||||
}
|
||||
}
|
||||
|
||||
// top bar
|
||||
|
||||
Loading…
Reference in New Issue
Block a user