mirror of
https://github.com/2dust/v2rayN.git
synced 2025-10-14 12:29:13 +00:00
Enable Tun SplitCore
This commit is contained in:
parent
0a2b4374f9
commit
896ec62232
1 changed files with 17 additions and 3 deletions
|
@ -247,16 +247,30 @@ public class CoreHandler
|
||||||
PreSocksPort = AppHandler.Instance.GetLocalPort(EInboundProtocol.split);
|
PreSocksPort = AppHandler.Instance.GetLocalPort(EInboundProtocol.split);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (EnableTun)
|
||||||
|
{
|
||||||
|
PreCoreType = ECoreType.sing_box;
|
||||||
|
|
||||||
|
if (PreCoreType != CoreType) // CoreType is xray
|
||||||
|
{
|
||||||
|
SplitCore = true;
|
||||||
|
PreSocksPort = AppHandler.Instance.GetLocalPort(EInboundProtocol.split);
|
||||||
|
}
|
||||||
|
else // CoreType is sing_box
|
||||||
|
{
|
||||||
|
PreCoreType = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<bool> CoreStart(CoreLaunchContext context)
|
private async Task<bool> CoreStart(CoreLaunchContext context)
|
||||||
{
|
{
|
||||||
var fileName = Utils.GetBinConfigPath(Global.CoreConfigFileName);
|
var fileName = Utils.GetBinConfigPath(Global.CoreConfigFileName);
|
||||||
var result = context.SplitCore
|
var result = context.SplitCore
|
||||||
? await CoreConfigHandler.GeneratePureEndpointConfig(context.Node, fileName)
|
? await CoreConfigHandler.GeneratePureEndpointConfig(context.Node, fileName)
|
||||||
: await CoreConfigHandler.GenerateClientConfig(context.Node, fileName);
|
: await CoreConfigHandler.GenerateClientConfig(context.Node, fileName);
|
||||||
|
|
||||||
if (result.Success != true)
|
if (result.Success != true)
|
||||||
{
|
{
|
||||||
UpdateFunc(true, result.Msg);
|
UpdateFunc(true, result.Msg);
|
||||||
|
|
Loading…
Reference in a new issue