|
|
|
@ -337,16 +337,16 @@ namespace v2rayN.Handler
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
//if (_config.coreBasicItem.muxEnabled)
|
|
|
|
|
//{
|
|
|
|
|
// var mux = new Multiplex4Sbox()
|
|
|
|
|
// {
|
|
|
|
|
// enabled = true,
|
|
|
|
|
// protocol = _config.mux4SboxItem.protocol,
|
|
|
|
|
// max_connections = _config.mux4SboxItem.max_connections,
|
|
|
|
|
// };
|
|
|
|
|
// outbound.multiplex = mux;
|
|
|
|
|
//}
|
|
|
|
|
if (_config.coreBasicItem.muxEnabled && !Utils.IsNullOrEmpty(_config.mux4SboxItem.protocol))
|
|
|
|
|
{
|
|
|
|
|
var mux = new Multiplex4Sbox()
|
|
|
|
|
{
|
|
|
|
|
enabled = true,
|
|
|
|
|
protocol = _config.mux4SboxItem.protocol,
|
|
|
|
|
max_connections = _config.mux4SboxItem.max_connections,
|
|
|
|
|
};
|
|
|
|
|
outbound.multiplex = mux;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
@ -822,7 +822,7 @@ namespace v2rayN.Handler
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private int GenExperimentalStatistic(SingboxConfig singboxConfig)
|
|
|
|
|
private int GenExperimental(SingboxConfig singboxConfig)
|
|
|
|
|
{
|
|
|
|
|
if (_config.guiItem.enableStatistics)
|
|
|
|
|
{
|
|
|
|
@ -831,39 +831,8 @@ namespace v2rayN.Handler
|
|
|
|
|
{
|
|
|
|
|
external_controller = $"{Global.Loopback}:{LazyConfig.Instance.StatePort}",
|
|
|
|
|
};
|
|
|
|
|
// singboxConfig.experimental.v2ray_api = new V2ray_Api4Sbox()
|
|
|
|
|
// {
|
|
|
|
|
// listen = $"{Global.Loopback}:{Global.StatePort}",
|
|
|
|
|
// stats = new Stats4Sbox()
|
|
|
|
|
// {
|
|
|
|
|
// enabled = true,
|
|
|
|
|
// }
|
|
|
|
|
// };
|
|
|
|
|
// singboxConfig.experimental = new Experimental4Sbox()
|
|
|
|
|
// {
|
|
|
|
|
// cache_file = new CacheFile4Sbox()
|
|
|
|
|
// {
|
|
|
|
|
// enabled = true
|
|
|
|
|
// },
|
|
|
|
|
// //v2ray_api = new V2ray_Api4Sbox()
|
|
|
|
|
// //{
|
|
|
|
|
// // listen = $"{Global.Loopback}:{Global.StatePort}",
|
|
|
|
|
// // stats = new Stats4Sbox()
|
|
|
|
|
// // {
|
|
|
|
|
// // enabled = true,
|
|
|
|
|
// // }
|
|
|
|
|
// //},
|
|
|
|
|
// clash_api = new Clash_Api4Sbox()
|
|
|
|
|
// {
|
|
|
|
|
// external_controller = $"{Global.Loopback}:{LazyConfig.Instance.StatePort}",
|
|
|
|
|
// }
|
|
|
|
|
// };
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private int GenExperimentalCacheFile(SingboxConfig singboxConfig)
|
|
|
|
|
{
|
|
|
|
|
if (_config.coreBasicItem.enableCacheFile4Sbox)
|
|
|
|
|
{
|
|
|
|
|
singboxConfig.experimental ??= new Experimental4Sbox();
|
|
|
|
@ -876,15 +845,6 @@ namespace v2rayN.Handler
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private int GenExperimental(SingboxConfig singboxConfig)
|
|
|
|
|
{
|
|
|
|
|
var r = GenExperimentalStatistic(singboxConfig);
|
|
|
|
|
if (r != 0) return r;
|
|
|
|
|
r = GenExperimentalCacheFile(singboxConfig);
|
|
|
|
|
if (r != 0) return r;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private int ConvertGeo2Ruleset(SingboxConfig singboxConfig)
|
|
|
|
|
{
|
|
|
|
|
var geosite = "geosite";
|
|
|
|
|