mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-20 02:40:20 +08:00
add: added External resolver, fixed DNS settings empty clientIP
This commit is contained in:
parent
92a8b22f65
commit
dde2849d49
@ -1 +1 @@
|
||||
5854
|
||||
5855
|
||||
|
@ -82,6 +82,23 @@ namespace Qv2ray::core::handler
|
||||
return newOutbounds;
|
||||
}
|
||||
|
||||
OUTBOUNDS RouteHandler::ExpandConnectionId(const OUTBOUNDS &outbounds) const
|
||||
{
|
||||
OUTBOUNDS result;
|
||||
for (const auto &out : outbounds)
|
||||
{
|
||||
auto outObject = out.toObject();
|
||||
const auto meta = OutboundObjectMeta::loadFromOutbound(OUTBOUND(outObject));
|
||||
if (meta.metaType == METAOUTBOUND_EXTERNAL)
|
||||
{
|
||||
outObject = ConnectionManager->GetConnectionRoot(meta.connectionId)["outbounds"].toArray().first().toObject();
|
||||
outObject["tag"] = meta.getDisplayName();
|
||||
}
|
||||
result << outObject;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
OUTBOUNDS RouteHandler::ExpandProxyChains(const OUTBOUNDS &outbounds) const
|
||||
{
|
||||
QMap<QString, OUTBOUND> outboundMap;
|
||||
@ -157,6 +174,7 @@ namespace Qv2ray::core::handler
|
||||
|
||||
routing["rules"] = newRules;
|
||||
root["routing"] = routing;
|
||||
root["outbounds"] = ExpandConnectionId(OUTBOUNDS(root["outbounds"].toArray()));
|
||||
root["outbounds"] = ExpandProxyChains(OUTBOUNDS(root["outbounds"].toArray()));
|
||||
}
|
||||
else
|
||||
|
@ -24,6 +24,9 @@ namespace Qv2ray::core::handler
|
||||
//
|
||||
bool SetDNSSettings(const GroupRoutingId &id, bool overrideGlobal, const QvConfig_DNS &dns);
|
||||
bool SetAdvancedRouteSettings(const GroupRoutingId &id, bool overrideGlobal, const QvConfig_Route &dns);
|
||||
//
|
||||
OUTBOUNDS ExpandConnectionId(const OUTBOUNDS &outbounds) const;
|
||||
//
|
||||
OUTBOUNDS ExpandProxyChains(const QMap<QString, OUTBOUND> &outbounds) const;
|
||||
OUTBOUNDS ExpandProxyChains(const OUTBOUNDS &outbounds) const;
|
||||
//
|
||||
|
@ -279,7 +279,7 @@ CONFIGROOT RouteEditor::OpenEditor()
|
||||
outboundsArray.append(outboundJsonObject);
|
||||
}
|
||||
root["outbounds"] = outboundsArray;
|
||||
root["dns"] = dnsWidget->GetDNSObject().toJson();
|
||||
root["dns"] = GenerateDNS(false, dnsWidget->GetDNSObject());
|
||||
return root;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user