Add basic rules for sing-box

pull/3756/head
2dust 2023-04-24 09:40:38 +08:00
parent a262c1e98d
commit 6340764a6c
3 changed files with 20 additions and 10 deletions

View File

@ -136,7 +136,6 @@ namespace v2rayN.Base
var data = new byte[read];
buffer.ToList().CopyTo(0, data, 0, read);
// TODO:
totalRead += read;
TimeSpan ts = (DateTime.Now - totalDatetime);

View File

@ -326,13 +326,28 @@ namespace v2rayN.Handler
{
try
{
var routing = ConfigHandler.GetDefaultRouting(ref _config);
if (routing != null)
if (_config.routingBasicItem.enableRoutingAdvanced)
{
var rules = Utils.FromJson<List<RulesItem>>(routing.ruleSet);
foreach (var item in rules!)
var routing = ConfigHandler.GetDefaultRouting(ref _config);
if (routing != null)
{
if (item.enabled)
var rules = Utils.FromJson<List<RulesItem>>(routing.ruleSet);
foreach (var item in rules!)
{
if (item.enabled)
{
routingUserRule(item, singboxConfig.route.rules);
}
}
}
}
else
{
var lockedItem = ConfigHandler.GetLockedRoutingItem(ref _config);
if (lockedItem != null)
{
var rules = Utils.FromJson<List<RulesItem>>(lockedItem.ruleSet);
foreach (var item in rules!)
{
routingUserRule(item, singboxConfig.route.rules);
}

View File

@ -484,7 +484,6 @@ namespace v2rayN.Handler
switch (i.streamSecurity)
{
case "tls":
// TODO tls config
break;
default:
@ -499,13 +498,10 @@ namespace v2rayN.Handler
case "tcp":
string t1 = q["type"] ?? "none";
i.headerType = t1;
// TODO http option
break;
case "kcp":
i.headerType = q["type"] ?? "none";
// TODO kcp seed
break;
case "ws":