fix clash config
This commit is contained in:
@@ -956,6 +956,18 @@ namespace v2rayN.Handler
|
|||||||
break;
|
break;
|
||||||
case ECoreType.clash:
|
case ECoreType.clash:
|
||||||
case ECoreType.clash_meta:
|
case ECoreType.clash_meta:
|
||||||
|
//remove the original
|
||||||
|
var indexPort = fileContent.FindIndex(t => t.Contains("port:"));
|
||||||
|
if (indexPort >= 0)
|
||||||
|
{
|
||||||
|
fileContent.RemoveAt(indexPort);
|
||||||
|
}
|
||||||
|
indexPort = fileContent.FindIndex(t => t.Contains("socks-port:"));
|
||||||
|
if (indexPort >= 0)
|
||||||
|
{
|
||||||
|
fileContent.RemoveAt(indexPort);
|
||||||
|
}
|
||||||
|
|
||||||
fileContent.Add($"port: {LazyConfig.Instance.GetConfig().GetLocalPort(Global.InboundHttp)}");
|
fileContent.Add($"port: {LazyConfig.Instance.GetConfig().GetLocalPort(Global.InboundHttp)}");
|
||||||
fileContent.Add($"socks-port: {LazyConfig.Instance.GetConfig().GetLocalPort(Global.InboundSocks)}");
|
fileContent.Add($"socks-port: {LazyConfig.Instance.GetConfig().GetLocalPort(Global.InboundSocks)}");
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user