mirror of
https://github.com/2dust/v2rayN.git
synced 2026-02-28 05:03:02 +00:00
Fix
This commit is contained in:
parent
9a451e73bd
commit
0c3e42efa6
1 changed files with 11 additions and 20 deletions
|
|
@ -1233,19 +1233,11 @@ public static class ConfigHandler
|
||||||
/// <returns>A SOCKS profile item or null if not needed</returns>
|
/// <returns>A SOCKS profile item or null if not needed</returns>
|
||||||
public static ProfileItem? GetPreSocksItem(Config config, ProfileItem node, ECoreType coreType)
|
public static ProfileItem? GetPreSocksItem(Config config, ProfileItem node, ECoreType coreType)
|
||||||
{
|
{
|
||||||
ProfileItem? itemSocks = null;
|
if (node.ConfigType != EConfigType.Custom || !(node.PreSocksPort > 0))
|
||||||
if (node.ConfigType != EConfigType.Custom && coreType != ECoreType.sing_box && config.TunModeItem.EnableTun)
|
|
||||||
{
|
{
|
||||||
itemSocks = new ProfileItem()
|
return null;
|
||||||
{
|
|
||||||
CoreType = ECoreType.sing_box,
|
|
||||||
ConfigType = EConfigType.SOCKS,
|
|
||||||
Address = Global.Loopback,
|
|
||||||
Port = AppManager.Instance.GetLocalPort(EInboundProtocol.socks)
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
else if (node.ConfigType == EConfigType.Custom && node.PreSocksPort > 0)
|
ProfileItem? itemSocks = null;
|
||||||
{
|
|
||||||
var preCoreType = AppManager.Instance.RunningCoreType = config.TunModeItem.EnableTun ? ECoreType.sing_box : ECoreType.Xray;
|
var preCoreType = AppManager.Instance.RunningCoreType = config.TunModeItem.EnableTun ? ECoreType.sing_box : ECoreType.Xray;
|
||||||
itemSocks = new ProfileItem()
|
itemSocks = new ProfileItem()
|
||||||
{
|
{
|
||||||
|
|
@ -1254,7 +1246,6 @@ public static class ConfigHandler
|
||||||
Address = Global.Loopback,
|
Address = Global.Loopback,
|
||||||
Port = node.PreSocksPort.Value,
|
Port = node.PreSocksPort.Value,
|
||||||
};
|
};
|
||||||
}
|
|
||||||
return itemSocks;
|
return itemSocks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue