Add hysteria support

This commit is contained in:
2dust 2022-03-28 19:08:54 +08:00
parent ece4572058
commit 70feacd276
5 changed files with 22 additions and 2 deletions

View file

@ -19,6 +19,7 @@ namespace v2rayN.Forms
{ {
cmbCoreType.Items.AddRange(Global.coreTypes.ToArray()); cmbCoreType.Items.AddRange(Global.coreTypes.ToArray());
cmbCoreType.Items.Add("clash"); cmbCoreType.Items.Add("clash");
cmbCoreType.Items.Add("hysteria");
cmbCoreType.Items.Add(string.Empty); cmbCoreType.Items.Add(string.Empty);
txtAddress.ReadOnly = true; txtAddress.ReadOnly = true;

View file

@ -15,8 +15,9 @@ namespace v2rayN
public const string xrayCoreUrl = "https://github.com/XTLS/Xray-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 NUrl = @"https://github.com/2dust/v2rayN/releases";
public const string clashCoreUrl = "https://github.com/Dreamacro/clash/releases"; public const string clashCoreUrl = "https://github.com/Dreamacro/clash/releases";
public const string hysteriaCoreUrl = "https://github.com/HyNetwork/hysteria/releases";
/// <summary> /// <summary>

View file

@ -940,6 +940,15 @@ namespace v2rayN.Handler
vmessItem.coreType = ECoreType.clash; vmessItem.coreType = ECoreType.clash;
vmessItem.address = fileName; vmessItem.address = fileName;
vmessItem.remarks = "clash_custom"; vmessItem.remarks = "clash_custom";
}
//Is Other configuration
else
{
var fileName = Utils.GetTempPath($"{Utils.GetGUID(false)}.txt");
File.WriteAllText(fileName, clipboardData);
vmessItem.address = fileName;
vmessItem.remarks = "other_custom";
} }
if (!Utils.IsNullOrEmpty(subid)) if (!Utils.IsNullOrEmpty(subid))

View file

@ -90,6 +90,14 @@ namespace v2rayN.Handler
arguments = "-f config.json", arguments = "-f config.json",
coreUrl = Global.clashCoreUrl coreUrl = Global.clashCoreUrl
}); });
coreInfos.Add(new CoreInfo
{
coreType = ECoreType.hysteria,
coreExes = new List<string> { "hysteria-tun-windows-6.0-amd64", "hysteria-tun-windows-6.0-386", "hysteria" },
arguments = "",
coreUrl = Global.hysteriaCoreUrl
});
} }
} }

View file

@ -5,7 +5,8 @@ namespace v2rayN.Mode
{ {
v2fly = 1, v2fly = 1,
Xray = 2, Xray = 2,
clash = 3, clash = 11,
hysteria = 21,
v2rayN = 99 v2rayN = 99
} }
} }