mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-18 18:00:25 +08:00
add: use v2ray DNS for freedom outbound
This commit is contained in:
parent
f08ea62e47
commit
8411ea9f68
@ -1 +1 @@
|
||||
5330
|
||||
5331
|
@ -168,15 +168,17 @@ namespace Qv2ray::base::config
|
||||
{
|
||||
bool bypassCN;
|
||||
bool enableProxy;
|
||||
bool v2rayFreedomDNS;
|
||||
bool withLocalDNS;
|
||||
Qv2rayRouteConfig routeConfig;
|
||||
QList<QString> dnsList;
|
||||
Qv2rayForwardProxyConfig forwardProxyConfig;
|
||||
Qv2rayConnectionConfig()
|
||||
: bypassCN(true), enableProxy(true), withLocalDNS(false), routeConfig(), dnsList(QStringList{ "8.8.4.4", "1.1.1.1" })
|
||||
: bypassCN(true), enableProxy(true), v2rayFreedomDNS(false), withLocalDNS(false), routeConfig(),
|
||||
dnsList(QStringList{ "8.8.4.4", "1.1.1.1" })
|
||||
{
|
||||
}
|
||||
XTOSTRUCT(O(bypassCN, enableProxy, withLocalDNS, dnsList, forwardProxyConfig, routeConfig))
|
||||
XTOSTRUCT(O(bypassCN, enableProxy, v2rayFreedomDNS, withLocalDNS, dnsList, forwardProxyConfig, routeConfig))
|
||||
};
|
||||
|
||||
struct Qv2rayAPIConfig
|
||||
|
@ -509,7 +509,7 @@ namespace Qv2ray::core::connection
|
||||
#undef fpConf
|
||||
OUTBOUNDS outbounds(root["outbounds"].toArray());
|
||||
//
|
||||
const auto freeDS = (GlobalConfig.inboundConfig.useTPROXY && GlobalConfig.inboundConfig.dnsIntercept) ? "UseIP" : "AsIs";
|
||||
const auto freeDS = (GlobalConfig.connectionConfig.v2rayFreedomDNS) ? "UseIP" : "AsIs";
|
||||
//
|
||||
outbounds.append(GenerateOutboundEntry("freedom", GenerateFreedomOUT(freeDS, ":0", 0), {}, {}, "0.0.0.0", OUTBOUND_TAG_DIRECT));
|
||||
outbounds.append(GenerateOutboundEntry("blackhole", GenerateBlackHoleOUT(false), {}, {}, "0.0.0.0", OUTBOUND_TAG_BLACKHOLE));
|
||||
|
@ -129,6 +129,7 @@ PreferencesWindow::PreferencesWindow(QWidget *parent) : QDialog(parent), Current
|
||||
tproxyMode->setCurrentText(CurrentConfig.inboundConfig.tproxy_mode);
|
||||
outboundMark->setValue(CurrentConfig.outboundConfig.mark);
|
||||
dnsIntercept->setChecked(CurrentConfig.inboundConfig.dnsIntercept);
|
||||
DnsFreedomCb->setChecked(CurrentConfig.connectionConfig.v2rayFreedomDNS);
|
||||
//
|
||||
//
|
||||
vCorePathTxt->setText(CurrentConfig.kernelConfig.KernelPath());
|
||||
@ -1296,3 +1297,9 @@ void PreferencesWindow::on_qvProxyNoProxy_clicked()
|
||||
{
|
||||
CurrentConfig.networkConfig.proxyType = Qv2rayNetworkConfig::QVPROXY_NONE;
|
||||
}
|
||||
|
||||
void PreferencesWindow::on_DnsFreedomCb_stateChanged(int arg1)
|
||||
{
|
||||
NEEDRESTART
|
||||
CurrentConfig.connectionConfig.v2rayFreedomDNS = arg1 == Qt::Checked;
|
||||
}
|
||||
|
@ -202,6 +202,8 @@ class PreferencesWindow
|
||||
|
||||
void on_qvProxyNoProxy_clicked();
|
||||
|
||||
void on_DnsFreedomCb_stateChanged(int arg1);
|
||||
|
||||
private:
|
||||
//
|
||||
RouteSettingsMatrixWidget *routeSettingsWidget;
|
||||
|
@ -1171,29 +1171,43 @@ Custom DNS Settings</string>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_18">
|
||||
<widget class="QLabel" name="label_75">
|
||||
<property name="text">
|
||||
<string>Use Local DNS</string>
|
||||
<string>Use V2ray Dns for Freedom Outbound</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="localDNSCb">
|
||||
<widget class="QCheckBox" name="DnsFreedomCb">
|
||||
<property name="text">
|
||||
<string>Enabled</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_18">
|
||||
<property name="text">
|
||||
<string>Use Local DNS</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_21">
|
||||
<property name="text">
|
||||
<string>Custom DNS List</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="4" column="1">
|
||||
<widget class="QPlainTextEdit" name="DNSListTxt"/>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QCheckBox" name="localDNSCb">
|
||||
<property name="text">
|
||||
<string>Enabled</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -1213,6 +1227,13 @@ Custom DNS Settings</string>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_8">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_65">
|
||||
<property name="text">
|
||||
<string>Only simple config is supported.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_49">
|
||||
<property name="text">
|
||||
@ -1298,13 +1319,6 @@ Custom DNS Settings</string>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="fpPasswordTx"/>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_65">
|
||||
<property name="text">
|
||||
<string>Only simple config is supported.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -2052,7 +2066,6 @@ Custom DNS Settings</string>
|
||||
<tabstop>httpAuthPasswordTxt</tabstop>
|
||||
<tabstop>proxyDefaultCb</tabstop>
|
||||
<tabstop>bypassCNCb</tabstop>
|
||||
<tabstop>localDNSCb</tabstop>
|
||||
<tabstop>DNSListTxt</tabstop>
|
||||
<tabstop>fpGroupBox</tabstop>
|
||||
<tabstop>fpTypeCombo</tabstop>
|
||||
|
Loading…
Reference in New Issue
Block a user