mirror of
https://github.com/2dust/v2rayN.git
synced 2025-05-02 13:18:50 +00:00
fix clash config
This commit is contained in:
parent
eddd38ff03
commit
d418f79d8f
1 changed files with 12 additions and 0 deletions
|
@ -956,6 +956,18 @@ namespace v2rayN.Handler
|
|||
break;
|
||||
case ECoreType.clash:
|
||||
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($"socks-port: {LazyConfig.Instance.GetConfig().GetLocalPort(Global.InboundSocks)}");
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue