mirror of
https://github.com/2dust/v2rayN.git
synced 2025-12-23 07:12:42 +00:00
Compare commits
3 commits
bbedc4dbb1
...
b4c20e7b81
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4c20e7b81 | ||
|
|
7c76308c93 | ||
|
|
f28fa31c14 |
3 changed files with 12 additions and 3 deletions
|
|
@ -1221,6 +1221,7 @@ public static class ConfigHandler
|
|||
CoreType = coreType,
|
||||
ConfigType = EConfigType.PolicyGroup,
|
||||
Remarks = remark,
|
||||
IsSub = false
|
||||
};
|
||||
if (!subId.IsNullOrEmpty())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -97,9 +97,12 @@ public partial class CoreConfigV2rayService
|
|||
continue;
|
||||
}
|
||||
}
|
||||
else if (!fullConfigTemplate.ProxyDetour.IsNullOrEmpty())
|
||||
else if ((!fullConfigTemplate.ProxyDetour.IsNullOrEmpty())
|
||||
&& ((outbound.streamSettings?.sockopt?.dialerProxy.IsNullOrEmpty() ?? true) == true))
|
||||
{
|
||||
var outboundAddress = outbound.settings?.servers?.FirstOrDefault()?.address ?? outbound.settings?.vnext?.FirstOrDefault()?.address ?? string.Empty;
|
||||
var outboundAddress = outbound.settings?.servers?.FirstOrDefault()?.address
|
||||
?? outbound.settings?.vnext?.FirstOrDefault()?.address
|
||||
?? string.Empty;
|
||||
if (!Utils.IsPrivateNetwork(outboundAddress))
|
||||
{
|
||||
outbound.streamSettings ??= new StreamSettings4Ray();
|
||||
|
|
|
|||
|
|
@ -82,11 +82,16 @@ public partial class CoreConfigV2rayService
|
|||
var (domain, scheme, port, path) = Utils.ParseUrl(dnsAddress);
|
||||
var domainFinal = dnsAddress;
|
||||
int? portFinal = null;
|
||||
if (scheme.IsNullOrEmpty() || scheme.Contains("udp", StringComparison.OrdinalIgnoreCase) || scheme.Contains("tcp", StringComparison.OrdinalIgnoreCase))
|
||||
if (scheme.IsNullOrEmpty() || scheme.StartsWith("udp", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
domainFinal = domain;
|
||||
portFinal = port > 0 ? port : null;
|
||||
}
|
||||
else if (scheme.StartsWith("tcp", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
domainFinal = scheme + "://" + domain;
|
||||
portFinal = port > 0 ? port : null;
|
||||
}
|
||||
var dnsServer = new DnsServer4Ray
|
||||
{
|
||||
address = domainFinal,
|
||||
|
|
|
|||
Loading…
Reference in a new issue