mirror of https://github.com/2dust/v2rayN
Add basic rules for sing-box
parent
a262c1e98d
commit
6340764a6c
|
@ -136,7 +136,6 @@ namespace v2rayN.Base
|
||||||
var data = new byte[read];
|
var data = new byte[read];
|
||||||
buffer.ToList().CopyTo(0, data, 0, read);
|
buffer.ToList().CopyTo(0, data, 0, read);
|
||||||
|
|
||||||
// TODO:
|
|
||||||
totalRead += read;
|
totalRead += read;
|
||||||
|
|
||||||
TimeSpan ts = (DateTime.Now - totalDatetime);
|
TimeSpan ts = (DateTime.Now - totalDatetime);
|
||||||
|
|
|
@ -325,6 +325,8 @@ namespace v2rayN.Handler
|
||||||
private int routing(SingboxConfig singboxConfig)
|
private int routing(SingboxConfig singboxConfig)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
{
|
||||||
|
if (_config.routingBasicItem.enableRoutingAdvanced)
|
||||||
{
|
{
|
||||||
var routing = ConfigHandler.GetDefaultRouting(ref _config);
|
var routing = ConfigHandler.GetDefaultRouting(ref _config);
|
||||||
if (routing != null)
|
if (routing != null)
|
||||||
|
@ -339,6 +341,19 @@ namespace v2rayN.Handler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Utils.SaveLog(ex.Message, ex);
|
Utils.SaveLog(ex.Message, ex);
|
||||||
|
|
|
@ -484,7 +484,6 @@ namespace v2rayN.Handler
|
||||||
switch (i.streamSecurity)
|
switch (i.streamSecurity)
|
||||||
{
|
{
|
||||||
case "tls":
|
case "tls":
|
||||||
// TODO tls config
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -499,13 +498,10 @@ namespace v2rayN.Handler
|
||||||
case "tcp":
|
case "tcp":
|
||||||
string t1 = q["type"] ?? "none";
|
string t1 = q["type"] ?? "none";
|
||||||
i.headerType = t1;
|
i.headerType = t1;
|
||||||
// TODO http option
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "kcp":
|
case "kcp":
|
||||||
i.headerType = q["type"] ?? "none";
|
i.headerType = q["type"] ?? "none";
|
||||||
// TODO kcp seed
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "ws":
|
case "ws":
|
||||||
|
|
Loading…
Reference in New Issue