Browse Source

add clash.meta core

pull/2192/head
2dust 3 years ago
parent
commit
90289120d3
  1. 1
      v2rayN/v2rayN/Forms/AddServer2Form.cs
  2. 1
      v2rayN/v2rayN/Global.cs
  3. 9
      v2rayN/v2rayN/Handler/LazyConfig.cs
  4. 1
      v2rayN/v2rayN/Handler/V2rayConfigHandler.cs
  5. 1
      v2rayN/v2rayN/Mode/ECoreType.cs

1
v2rayN/v2rayN/Forms/AddServer2Form.cs

@ -20,6 +20,7 @@ namespace v2rayN.Forms
{
cmbCoreType.Items.AddRange(Global.coreTypes.ToArray());
cmbCoreType.Items.Add("clash");
cmbCoreType.Items.Add("clash_meta");
cmbCoreType.Items.Add("hysteria");
cmbCoreType.Items.Add(string.Empty);

1
v2rayN/v2rayN/Global.cs

@ -15,6 +15,7 @@ namespace v2rayN
public const string xrayCoreUrl = "https://github.com/XTLS/Xray-core/releases";
public const string NUrl = @"https://github.com/2dust/v2rayN/releases";
public const string clashCoreUrl = "https://github.com/Dreamacro/clash/releases";
public const string clashMetaCoreUrl = "https://github.com/MetaCubeX/Clash.Meta/releases";
public const string hysteriaCoreUrl = "https://github.com/HyNetwork/hysteria/releases";

9
v2rayN/v2rayN/Handler/LazyConfig.cs

@ -92,6 +92,15 @@ namespace v2rayN.Handler
coreUrl = Global.clashCoreUrl
});
coreInfos.Add(new CoreInfo
{
coreType = ECoreType.clash_meta,
coreExes = new List<string> { "Clash.Meta-windows-amd64v1", "Clash.Meta-windows-amd64", "Clash.Meta-windows-386", "Clash.Meta", "clash" },
arguments = "-f config.yaml",
coreUrl = Global.clashMetaCoreUrl,
match = "Clash Meta"
});
coreInfos.Add(new CoreInfo
{
coreType = ECoreType.hysteria,

1
v2rayN/v2rayN/Handler/V2rayConfigHandler.cs

@ -957,6 +957,7 @@ namespace v2rayN.Handler
case ECoreType.Xray:
break;
case ECoreType.clash:
case ECoreType.clash_meta:
fileContent.Add($"port: {LazyConfig.Instance.GetConfig().GetLocalPort(Global.InboundHttp2)}");
fileContent.Add($"socks-port: {LazyConfig.Instance.GetConfig().GetLocalPort(Global.InboundSocks)}");
break;

1
v2rayN/v2rayN/Mode/ECoreType.cs

@ -6,6 +6,7 @@ namespace v2rayN.Mode
v2fly = 1,
Xray = 2,
clash = 11,
clash_meta = 12,
hysteria = 21,
v2rayN = 99
}

Loading…
Cancel
Save