mirror of
https://github.com/2dust/v2rayN.git
synced 2025-10-26 18:24:43 +00:00
Compare commits
No commits in common. "79a0538ca0ea952ff7b14b368e9bbabf7928019c" and "6914831d30e026048b11d42baf4cea27b62784dd" have entirely different histories.
79a0538ca0
...
6914831d30
5 changed files with 101 additions and 127 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
namespace ServiceLib.Enums
|
namespace ServiceLib.Enums
|
||||||
{
|
{
|
||||||
public enum ECoreType
|
public enum ECoreType
|
||||||
{
|
{
|
||||||
|
|
@ -12,8 +12,6 @@ namespace ServiceLib.Enums
|
||||||
sing_box = 24,
|
sing_box = 24,
|
||||||
juicity = 25,
|
juicity = 25,
|
||||||
hysteria2 = 26,
|
hysteria2 = 26,
|
||||||
brook = 27,
|
|
||||||
overtls = 28,
|
|
||||||
v2rayN = 99
|
v2rayN = 99
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
namespace ServiceLib
|
namespace ServiceLib
|
||||||
{
|
{
|
||||||
public class Global
|
public class Global
|
||||||
{
|
{
|
||||||
|
|
@ -7,8 +7,17 @@ namespace ServiceLib
|
||||||
public const string AppName = "v2rayN";
|
public const string AppName = "v2rayN";
|
||||||
public const string GithubUrl = "https://github.com";
|
public const string GithubUrl = "https://github.com";
|
||||||
public const string GithubApiUrl = "https://api.github.com/repos";
|
public const string GithubApiUrl = "https://api.github.com/repos";
|
||||||
|
public const string V2flyCoreUrl = "https://github.com/v2fly/v2ray-core/releases";
|
||||||
|
public const string XrayCoreUrl = "https://github.com/XTLS/Xray-core/releases";
|
||||||
|
public const string NUrl = @"https://github.com/2dust/v2rayN/releases";
|
||||||
|
public const string MihomoCoreUrl = "https://github.com/MetaCubeX/mihomo/releases";
|
||||||
|
public const string HysteriaCoreUrl = "https://github.com/apernet/hysteria/releases";
|
||||||
|
public const string NaiveproxyCoreUrl = "https://github.com/klzgrad/naiveproxy/releases";
|
||||||
|
public const string TuicCoreUrl = "https://github.com/EAimTY/tuic/releases";
|
||||||
|
public const string SingboxCoreUrl = "https://github.com/SagerNet/sing-box/releases";
|
||||||
public const string GeoUrl = "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/{0}.dat";
|
public const string GeoUrl = "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/{0}.dat";
|
||||||
public const string SpeedPingTestUrl = @"https://www.google.com/generate_204";
|
public const string SpeedPingTestUrl = @"https://www.google.com/generate_204";
|
||||||
|
public const string JuicityCoreUrl = "https://github.com/juicity/juicity/releases";
|
||||||
public const string SingboxRulesetUrl = @"https://raw.githubusercontent.com/2dust/sing-box-rules/rule-set-{0}/{1}.srs";
|
public const string SingboxRulesetUrl = @"https://raw.githubusercontent.com/2dust/sing-box-rules/rule-set-{0}/{1}.srs";
|
||||||
public const string IPAPIUrl = "https://api.ip.sb/geoip";
|
public const string IPAPIUrl = "https://api.ip.sb/geoip";
|
||||||
|
|
||||||
|
|
@ -159,27 +168,27 @@ namespace ServiceLib
|
||||||
|
|
||||||
public static readonly Dictionary<EConfigType, string> ProtocolShares = new()
|
public static readonly Dictionary<EConfigType, string> ProtocolShares = new()
|
||||||
{
|
{
|
||||||
{ EConfigType.VMess, "vmess://" },
|
{EConfigType.VMess,"vmess://"},
|
||||||
{ EConfigType.Shadowsocks, "ss://" },
|
{EConfigType.Shadowsocks,"ss://"},
|
||||||
{ EConfigType.SOCKS, "socks://" },
|
{EConfigType.SOCKS,"socks://"},
|
||||||
{ EConfigType.VLESS, "vless://" },
|
{EConfigType.VLESS,"vless://"},
|
||||||
{ EConfigType.Trojan, "trojan://" },
|
{EConfigType.Trojan,"trojan://"},
|
||||||
{ EConfigType.Hysteria2, "hysteria2://" },
|
{EConfigType.Hysteria2,"hysteria2://"},
|
||||||
{ EConfigType.TUIC, "tuic://" },
|
{EConfigType.TUIC,"tuic://"},
|
||||||
{ EConfigType.WireGuard, "wireguard://" }
|
{EConfigType.WireGuard,"wireguard://"}
|
||||||
};
|
};
|
||||||
|
|
||||||
public static readonly Dictionary<EConfigType, string> ProtocolTypes = new()
|
public static readonly Dictionary<EConfigType, string> ProtocolTypes = new()
|
||||||
{
|
{
|
||||||
{ EConfigType.VMess, "vmess" },
|
{EConfigType.VMess,"vmess"},
|
||||||
{ EConfigType.Shadowsocks, "shadowsocks" },
|
{EConfigType.Shadowsocks,"shadowsocks"},
|
||||||
{ EConfigType.SOCKS, "socks" },
|
{EConfigType.SOCKS,"socks"},
|
||||||
{ EConfigType.HTTP, "http" },
|
{EConfigType.HTTP,"http"},
|
||||||
{ EConfigType.VLESS, "vless" },
|
{EConfigType.VLESS,"vless"},
|
||||||
{ EConfigType.Trojan, "trojan" },
|
{EConfigType.Trojan,"trojan"},
|
||||||
{ EConfigType.Hysteria2, "hysteria2" },
|
{EConfigType.Hysteria2,"hysteria2"},
|
||||||
{ EConfigType.TUIC, "tuic" },
|
{EConfigType.TUIC,"tuic"},
|
||||||
{ EConfigType.WireGuard, "wireguard" }
|
{EConfigType.WireGuard,"wireguard"}
|
||||||
};
|
};
|
||||||
|
|
||||||
public static readonly List<string> VmessSecurities =
|
public static readonly List<string> VmessSecurities =
|
||||||
|
|
@ -491,23 +500,6 @@ namespace ServiceLib
|
||||||
"http"
|
"http"
|
||||||
];
|
];
|
||||||
|
|
||||||
public static readonly Dictionary<ECoreType, string> CoreUrls = new()
|
|
||||||
{
|
|
||||||
{ ECoreType.v2fly, "v2fly/v2ray-core" },
|
|
||||||
{ ECoreType.v2fly_v5, "v2fly/v2ray-core" },
|
|
||||||
{ ECoreType.Xray, "XTLS/Xray-core" },
|
|
||||||
{ ECoreType.sing_box, "SagerNet/sing-box" },
|
|
||||||
{ ECoreType.mihomo, "MetaCubeX/mihomo" },
|
|
||||||
{ ECoreType.hysteria, "apernet/hysteria" },
|
|
||||||
{ ECoreType.hysteria2, "apernet/hysteria" },
|
|
||||||
{ ECoreType.naiveproxy, "klzgrad/naiveproxy" },
|
|
||||||
{ ECoreType.tuic, "EAimTY/tuic" },
|
|
||||||
{ ECoreType.juicity, "juicity/juicity" },
|
|
||||||
{ ECoreType.brook, "txthinking/brook" },
|
|
||||||
{ ECoreType.overtls, "ShadowsocksR-Live/overtls" },
|
|
||||||
{ ECoreType.v2rayN, "2dust/v2rayN" },
|
|
||||||
};
|
|
||||||
|
|
||||||
#endregion const
|
#endregion const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -225,7 +225,7 @@ namespace ServiceLib.Handler
|
||||||
StartInfo = new()
|
StartInfo = new()
|
||||||
{
|
{
|
||||||
FileName = fileName,
|
FileName = fileName,
|
||||||
Arguments = string.Format(coreInfo.Arguments, coreInfo.AbsolutePath ? Utils.GetConfigPath(configPath) : configPath),
|
Arguments = string.Format(coreInfo.Arguments, configPath),
|
||||||
WorkingDirectory = Utils.GetConfigPath(),
|
WorkingDirectory = Utils.GetConfigPath(),
|
||||||
UseShellExecute = false,
|
UseShellExecute = false,
|
||||||
RedirectStandardOutput = displayLog,
|
RedirectStandardOutput = displayLog,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
namespace ServiceLib.Handler
|
namespace ServiceLib.Handler
|
||||||
{
|
{
|
||||||
public sealed class CoreInfoHandler
|
public sealed class CoreInfoHandler
|
||||||
{
|
{
|
||||||
|
|
@ -44,7 +44,7 @@ namespace ServiceLib.Handler
|
||||||
}
|
}
|
||||||
if (fileName.IsNullOrEmpty())
|
if (fileName.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
msg = string.Format(ResUI.NotFoundCore, Utils.GetBinPath("", coreInfo?.CoreType.ToString()), coreInfo?.CoreExes?.LastOrDefault(), coreInfo?.Url);
|
msg = string.Format(ResUI.NotFoundCore, Utils.GetBinPath("", coreInfo.CoreType.ToString()), string.Join(", ", coreInfo.CoreExes.ToArray()), coreInfo.Url);
|
||||||
Logging.SaveLog(msg);
|
Logging.SaveLog(msg);
|
||||||
}
|
}
|
||||||
return fileName;
|
return fileName;
|
||||||
|
|
@ -52,102 +52,107 @@ namespace ServiceLib.Handler
|
||||||
|
|
||||||
private void InitCoreInfo()
|
private void InitCoreInfo()
|
||||||
{
|
{
|
||||||
var urlN = GetCoreUrl(ECoreType.v2rayN);
|
|
||||||
var urlXray = GetCoreUrl(ECoreType.Xray);
|
|
||||||
var urlMihomo = GetCoreUrl(ECoreType.mihomo);
|
|
||||||
var urlSingbox = GetCoreUrl(ECoreType.sing_box);
|
|
||||||
|
|
||||||
_coreInfo =
|
_coreInfo =
|
||||||
[
|
[
|
||||||
new CoreInfo
|
new CoreInfo
|
||||||
{
|
{
|
||||||
CoreType = ECoreType.v2rayN,
|
CoreType = ECoreType.v2rayN,
|
||||||
Url = GetCoreUrl(ECoreType.v2rayN),
|
Url = Global.NUrl,
|
||||||
ReleaseApiUrl = urlN.Replace(Global.GithubUrl, Global.GithubApiUrl),
|
ReleaseApiUrl = Global.NUrl.Replace(Global.GithubUrl, Global.GithubApiUrl),
|
||||||
DownloadUrlWin64 = urlN + "/download/{0}/v2rayN-windows-64.zip",
|
DownloadUrlWin64 = Global.NUrl + "/download/{0}/v2rayN-windows-64.zip",
|
||||||
DownloadUrlWinArm64 = urlN + "/download/{0}/v2rayN-windows-arm64.zip",
|
DownloadUrlWinArm64 = Global.NUrl + "/download/{0}/v2rayN-windows-arm64.zip",
|
||||||
DownloadUrlLinux64 = urlN + "/download/{0}/v2rayN-linux-64.zip",
|
DownloadUrlLinux64 = Global.NUrl + "/download/{0}/v2rayN-linux-64.zip",
|
||||||
DownloadUrlLinuxArm64 = urlN + "/download/{0}/v2rayN-linux-arm64.zip",
|
DownloadUrlLinuxArm64 = Global.NUrl + "/download/{0}/v2rayN-linux-arm64.zip",
|
||||||
DownloadUrlOSX64 = urlN + "/download/{0}/v2rayN-macos-64.zip",
|
DownloadUrlOSX64 = Global.NUrl + "/download/{0}/v2rayN-macos-64.zip",
|
||||||
DownloadUrlOSXArm64 = urlN + "/download/{0}/v2rayN-macos-arm64.zip",
|
DownloadUrlOSXArm64 = Global.NUrl + "/download/{0}/v2rayN-macos-arm64.zip",
|
||||||
},
|
},
|
||||||
|
|
||||||
new CoreInfo
|
new CoreInfo
|
||||||
{
|
{
|
||||||
CoreType = ECoreType.v2fly,
|
CoreType = ECoreType.v2fly,
|
||||||
CoreExes = ["wv2ray", "v2ray"],
|
CoreExes = ["wv2ray", "v2ray"],
|
||||||
Arguments = "{0}",
|
Arguments = "",
|
||||||
Url = GetCoreUrl(ECoreType.v2fly),
|
Url = Global.V2flyCoreUrl,
|
||||||
|
ReleaseApiUrl = Global.V2flyCoreUrl.Replace(Global.GithubUrl, Global.GithubApiUrl),
|
||||||
Match = "V2Ray",
|
Match = "V2Ray",
|
||||||
VersionArg = "-version",
|
VersionArg = "-version",
|
||||||
|
RedirectInfo = true,
|
||||||
},
|
},
|
||||||
|
|
||||||
new CoreInfo
|
new CoreInfo
|
||||||
{
|
{
|
||||||
CoreType = ECoreType.v2fly_v5,
|
CoreType = ECoreType.v2fly_v5,
|
||||||
CoreExes = ["v2ray"],
|
CoreExes = ["v2ray"],
|
||||||
Arguments = "run -c {0} -format jsonv5",
|
Arguments = "run -c config.json -format jsonv5",
|
||||||
Url = GetCoreUrl(ECoreType.v2fly_v5),
|
Url = Global.V2flyCoreUrl,
|
||||||
|
ReleaseApiUrl = Global.V2flyCoreUrl.Replace(Global.GithubUrl, Global.GithubApiUrl),
|
||||||
Match = "V2Ray",
|
Match = "V2Ray",
|
||||||
VersionArg = "version",
|
VersionArg = "version",
|
||||||
|
RedirectInfo = true,
|
||||||
},
|
},
|
||||||
|
|
||||||
new CoreInfo
|
new CoreInfo
|
||||||
{
|
{
|
||||||
CoreType = ECoreType.Xray,
|
CoreType = ECoreType.Xray,
|
||||||
CoreExes = ["wxray","xray"],
|
CoreExes = ["xray", "wxray"],
|
||||||
Arguments = "run -c {0}",
|
Arguments = "run -c {0}",
|
||||||
Url = GetCoreUrl(ECoreType.Xray),
|
Url = Global.XrayCoreUrl,
|
||||||
ReleaseApiUrl = urlXray.Replace(Global.GithubUrl, Global.GithubApiUrl),
|
ReleaseApiUrl = Global.XrayCoreUrl.Replace(Global.GithubUrl, Global.GithubApiUrl),
|
||||||
DownloadUrlWin64 = urlXray + "/download/{0}/Xray-windows-64.zip",
|
DownloadUrlWin64 = Global.XrayCoreUrl + "/download/{0}/Xray-windows-64.zip",
|
||||||
DownloadUrlWinArm64 = urlXray + "/download/{0}/Xray-windows-arm64-v8a.zip",
|
DownloadUrlWinArm64 = Global.XrayCoreUrl + "/download/{0}/Xray-windows-arm64-v8a.zip",
|
||||||
DownloadUrlLinux64 = urlXray + "/download/{0}/Xray-linux-64.zip",
|
DownloadUrlLinux64 = Global.XrayCoreUrl + "/download/{0}/Xray-linux-64.zip",
|
||||||
DownloadUrlLinuxArm64 = urlXray + "/download/{0}/Xray-linux-arm64-v8a.zip",
|
DownloadUrlLinuxArm64 = Global.XrayCoreUrl + "/download/{0}/Xray-linux-arm64-v8a.zip",
|
||||||
DownloadUrlOSX64 = urlXray + "/download/{0}/Xray-macos-64.zip",
|
DownloadUrlOSX64 = Global.XrayCoreUrl + "/download/{0}/Xray-macos-64.zip",
|
||||||
DownloadUrlOSXArm64 = urlXray + "/download/{0}/Xray-macos-arm64-v8a.zip",
|
DownloadUrlOSXArm64 = Global.XrayCoreUrl + "/download/{0}/Xray-macos-arm64-v8a.zip",
|
||||||
Match = "Xray",
|
Match = "Xray",
|
||||||
VersionArg = "-version",
|
VersionArg = "-version",
|
||||||
|
RedirectInfo = true,
|
||||||
},
|
},
|
||||||
|
|
||||||
new CoreInfo
|
new CoreInfo
|
||||||
{
|
{
|
||||||
CoreType = ECoreType.mihomo,
|
CoreType = ECoreType.mihomo,
|
||||||
CoreExes = ["mihomo-windows-amd64-compatible", "mihomo-windows-amd64", "mihomo-linux-amd64", "clash", "mihomo"],
|
CoreExes = ["mihomo-windows-amd64-compatible", "mihomo-windows-amd64", "mihomo-linux-amd64", "mihomo", "clash"],
|
||||||
Arguments = "-f {0}" + PortableMode(),
|
Arguments = "-f config.json" + PortableMode(),
|
||||||
Url = GetCoreUrl(ECoreType.mihomo),
|
Url = Global.MihomoCoreUrl,
|
||||||
ReleaseApiUrl = urlMihomo.Replace(Global.GithubUrl, Global.GithubApiUrl),
|
ReleaseApiUrl = Global.MihomoCoreUrl.Replace(Global.GithubUrl, Global.GithubApiUrl),
|
||||||
DownloadUrlWin64 = urlMihomo + "/download/{0}/mihomo-windows-amd64-compatible-{0}.zip",
|
DownloadUrlWin64 = Global.MihomoCoreUrl + "/download/{0}/mihomo-windows-amd64-compatible-{0}.zip",
|
||||||
DownloadUrlWinArm64 = urlMihomo + "/download/{0}/mihomo-windows-arm64-{0}.zip",
|
DownloadUrlWinArm64 = Global.MihomoCoreUrl + "/download/{0}/mihomo-windows-arm64-{0}.zip",
|
||||||
DownloadUrlLinux64 = urlMihomo + "/download/{0}/mihomo-linux-amd64-compatible-{0}.gz",
|
DownloadUrlLinux64 = Global.MihomoCoreUrl + "/download/{0}/mihomo-linux-amd64-compatible-{0}.gz",
|
||||||
DownloadUrlLinuxArm64 = urlMihomo + "/download/{0}/mihomo-linux-arm64-{0}.gz",
|
DownloadUrlLinuxArm64 = Global.MihomoCoreUrl + "/download/{0}/mihomo-linux-arm64-{0}.gz",
|
||||||
DownloadUrlOSX64 = urlMihomo + "/download/{0}/mihomo-darwin-amd64-compatible-{0}.gz",
|
DownloadUrlOSX64 = Global.MihomoCoreUrl + "/download/{0}/mihomo-darwin-amd64-compatible-{0}.gz",
|
||||||
DownloadUrlOSXArm64 = urlMihomo + "/download/{0}/mihomo-darwin-arm64-{0}.gz",
|
DownloadUrlOSXArm64 = Global.MihomoCoreUrl + "/download/{0}/mihomo-darwin-arm64-{0}.gz",
|
||||||
Match = "Mihomo",
|
Match = "Mihomo",
|
||||||
VersionArg = "-v",
|
VersionArg = "-v",
|
||||||
|
RedirectInfo = true,
|
||||||
},
|
},
|
||||||
|
|
||||||
new CoreInfo
|
new CoreInfo
|
||||||
{
|
{
|
||||||
CoreType = ECoreType.hysteria,
|
CoreType = ECoreType.hysteria,
|
||||||
CoreExes = ["hysteria-windows-amd64", "hysteria"],
|
CoreExes = ["hysteria-windows-amd64", "hysteria"],
|
||||||
Arguments = "-c {0}",
|
Arguments = "",
|
||||||
Url = GetCoreUrl(ECoreType.hysteria),
|
Url = Global.HysteriaCoreUrl,
|
||||||
|
ReleaseApiUrl = Global.HysteriaCoreUrl.Replace(Global.GithubUrl, Global.GithubApiUrl),
|
||||||
|
RedirectInfo = true,
|
||||||
},
|
},
|
||||||
|
|
||||||
new CoreInfo
|
new CoreInfo
|
||||||
{
|
{
|
||||||
CoreType = ECoreType.naiveproxy,
|
CoreType = ECoreType.naiveproxy,
|
||||||
CoreExes = [ "naive", "naiveproxy"],
|
CoreExes = ["naiveproxy", "naive"],
|
||||||
Arguments = "{0}",
|
Arguments = "config.json",
|
||||||
Url = GetCoreUrl(ECoreType.naiveproxy),
|
Url = Global.NaiveproxyCoreUrl,
|
||||||
|
RedirectInfo = false,
|
||||||
},
|
},
|
||||||
|
|
||||||
new CoreInfo
|
new CoreInfo
|
||||||
{
|
{
|
||||||
CoreType = ECoreType.tuic,
|
CoreType = ECoreType.tuic,
|
||||||
CoreExes = ["tuic-client", "tuic"],
|
CoreExes = ["tuic-client", "tuic"],
|
||||||
Arguments = "-c {0}",
|
Arguments = "-c config.json",
|
||||||
Url = GetCoreUrl(ECoreType.tuic),
|
Url = Global.TuicCoreUrl,
|
||||||
|
RedirectInfo = true,
|
||||||
},
|
},
|
||||||
|
|
||||||
new CoreInfo
|
new CoreInfo
|
||||||
|
|
@ -155,15 +160,15 @@ namespace ServiceLib.Handler
|
||||||
CoreType = ECoreType.sing_box,
|
CoreType = ECoreType.sing_box,
|
||||||
CoreExes = ["sing-box-client", "sing-box"],
|
CoreExes = ["sing-box-client", "sing-box"],
|
||||||
Arguments = "run -c {0} --disable-color",
|
Arguments = "run -c {0} --disable-color",
|
||||||
Url = GetCoreUrl(ECoreType.sing_box),
|
Url = Global.SingboxCoreUrl,
|
||||||
|
RedirectInfo = true,
|
||||||
ReleaseApiUrl = urlSingbox.Replace(Global.GithubUrl, Global.GithubApiUrl),
|
ReleaseApiUrl = Global.SingboxCoreUrl.Replace(Global.GithubUrl, Global.GithubApiUrl),
|
||||||
DownloadUrlWin64 = urlSingbox + "/download/{0}/sing-box-{1}-windows-amd64.zip",
|
DownloadUrlWin64 = Global.SingboxCoreUrl + "/download/{0}/sing-box-{1}-windows-amd64.zip",
|
||||||
DownloadUrlWinArm64 = urlSingbox + "/download/{0}/sing-box-{1}-windows-arm64.zip",
|
DownloadUrlWinArm64 = Global.SingboxCoreUrl + "/download/{0}/sing-box-{1}-windows-arm64.zip",
|
||||||
DownloadUrlLinux64 = urlSingbox + "/download/{0}/sing-box-{1}-linux-amd64.tar.gz",
|
DownloadUrlLinux64 = Global.SingboxCoreUrl + "/download/{0}/sing-box-{1}-linux-amd64.tar.gz",
|
||||||
DownloadUrlLinuxArm64 = urlSingbox + "/download/{0}/sing-box-{1}-linux-arm64.tar.gz",
|
DownloadUrlLinuxArm64 = Global.SingboxCoreUrl + "/download/{0}/sing-box-{1}-linux-arm64.tar.gz",
|
||||||
DownloadUrlOSX64 = urlSingbox + "/download/{0}/sing-box-{1}-darwin-amd64.tar.gz",
|
DownloadUrlOSX64 = Global.SingboxCoreUrl + "/download/{0}/sing-box-{1}-darwin-amd64.tar.gz",
|
||||||
DownloadUrlOSXArm64 = urlSingbox + "/download/{0}/sing-box-{1}-darwin-arm64.tar.gz",
|
DownloadUrlOSXArm64 = Global.SingboxCoreUrl + "/download/{0}/sing-box-{1}-darwin-arm64.tar.gz",
|
||||||
Match = "sing-box",
|
Match = "sing-box",
|
||||||
VersionArg = "version",
|
VersionArg = "version",
|
||||||
},
|
},
|
||||||
|
|
@ -172,47 +177,26 @@ namespace ServiceLib.Handler
|
||||||
{
|
{
|
||||||
CoreType = ECoreType.juicity,
|
CoreType = ECoreType.juicity,
|
||||||
CoreExes = ["juicity-client", "juicity"],
|
CoreExes = ["juicity-client", "juicity"],
|
||||||
Arguments = "run -c {0}",
|
Arguments = "run -c config.json",
|
||||||
Url = GetCoreUrl(ECoreType.juicity)
|
Url = Global.JuicityCoreUrl
|
||||||
},
|
},
|
||||||
|
|
||||||
new CoreInfo
|
new CoreInfo
|
||||||
{
|
{
|
||||||
CoreType = ECoreType.hysteria2,
|
CoreType = ECoreType.hysteria2,
|
||||||
CoreExes = ["hysteria-windows-amd64", "hysteria-linux-amd64", "hysteria"],
|
CoreExes = ["hysteria-windows-amd64", "hysteria-linux-amd64", "hysteria"],
|
||||||
Arguments = "-c {0}",
|
Arguments = "",
|
||||||
Url = GetCoreUrl(ECoreType.hysteria2),
|
Url = Global.HysteriaCoreUrl,
|
||||||
},
|
ReleaseApiUrl = Global.HysteriaCoreUrl.Replace(Global.GithubUrl, Global.GithubApiUrl),
|
||||||
|
RedirectInfo = true,
|
||||||
new CoreInfo
|
|
||||||
{
|
|
||||||
CoreType = ECoreType.brook,
|
|
||||||
CoreExes = ["brook_windows_amd64", "brook_linux_amd64", "brook"],
|
|
||||||
Arguments = " {0}",
|
|
||||||
Url = GetCoreUrl(ECoreType.brook),
|
|
||||||
AbsolutePath = true,
|
|
||||||
},
|
|
||||||
|
|
||||||
new CoreInfo
|
|
||||||
{
|
|
||||||
CoreType = ECoreType.overtls,
|
|
||||||
CoreExes = [ "overtls-bin", "overtls"],
|
|
||||||
Arguments = "-r client -c {0}",
|
|
||||||
Url = GetCoreUrl(ECoreType.overtls),
|
|
||||||
AbsolutePath = false,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string PortableMode()
|
private string PortableMode()
|
||||||
{
|
{
|
||||||
return $" -d {Utils.GetBinPath("").AppendQuotes()}";
|
return $" -d {Utils.GetBinPath("").AppendQuotes()}";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string GetCoreUrl(ECoreType eCoreType)
|
|
||||||
{
|
|
||||||
return $"{Global.GithubUrl}/{Global.CoreUrls[eCoreType]}/releases";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
namespace ServiceLib.Models
|
namespace ServiceLib.Models
|
||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class CoreInfo
|
public class CoreInfo
|
||||||
|
|
@ -16,6 +16,6 @@ namespace ServiceLib.Models
|
||||||
public string? DownloadUrlOSXArm64 { get; set; }
|
public string? DownloadUrlOSXArm64 { get; set; }
|
||||||
public string? Match { get; set; }
|
public string? Match { get; set; }
|
||||||
public string? VersionArg { get; set; }
|
public string? VersionArg { get; set; }
|
||||||
public bool AbsolutePath { get; set; }
|
public bool RedirectInfo { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue