Skip to content

Commit

Permalink
Fill alpns & bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Jan 20, 2024
1 parent d7cb88f commit d76679c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/Global.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ internal class Global
public static readonly List<string> AllowInsecures = new() { "true", "false", "" };
public static readonly List<string> DomainStrategy4Freedoms = new() { "AsIs", "UseIP", "UseIPv4", "UseIPv6", "" };
public static readonly List<string> Languages = new() { "zh-Hans", "zh-Hant", "en", "fa-Ir", "ru" };
public static readonly List<string> Alpns = new() { "h2", "http/1.1", "h2,http/1.1", "h3", "" };
public static readonly List<string> Alpns = new() { "h3", "h2", "http/1.1", "h3,h2,http/1.1", "h3,h2", "h2,http/1.1", "" };
public static readonly List<string> LogLevels = new() { "debug", "info", "warning", "error", "none" };
public static readonly List<string> InboundTags = new() { "socks", "http", "socks2", "http2" };
public static readonly List<string> RuleProtocols = new() { "http", "tls", "bittorrent" };
Expand Down
14 changes: 7 additions & 7 deletions v2rayN/v2rayN/Handler/CoreConfigSingbox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -672,34 +672,34 @@ private void ParseV2Domain(string domain, Rule4Sbox rule)
}
else if (domain.StartsWith("geosite:"))
{
if (rule.geosite is null) { rule.geosite = new(); }
rule.geosite ??= [];
rule.geosite?.Add(domain.Substring(8));
}
else if (domain.StartsWith("regexp:"))
{
if (rule.domain_regex is null) { rule.domain_regex = new(); }
rule.domain_regex ??= [];
rule.domain_regex?.Add(domain.Replace(Global.RoutingRuleComma, ",").Substring(7));
}
else if (domain.StartsWith("domain:"))
{
if (rule.domain is null) { rule.domain = new(); }
if (rule.domain_suffix is null) { rule.domain_suffix = new(); }
rule.domain ??= [];
rule.domain_suffix ??= [];
rule.domain?.Add(domain.Substring(7));
rule.domain_suffix?.Add("." + domain.Substring(7));
}
else if (domain.StartsWith("full:"))
{
if (rule.domain is null) { rule.domain = new(); }
rule.domain ??= [];
rule.domain?.Add(domain.Substring(5));
}
else if (domain.StartsWith("keyword:"))
{
if (rule.domain_keyword is null) { rule.domain_keyword = new(); }
rule.domain_keyword ??= [];
rule.domain_keyword?.Add(domain.Substring(8));
}
else
{
if (rule.domain_keyword is null) { rule.domain_keyword = new(); }
rule.domain_keyword ??= [];
rule.domain_keyword?.Add(domain);
}
}
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/Handler/CoreConfigV2ray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ private int GenRouting(V2rayConfig v2rayConfig)
return 0;
}

private int GenRoutingUserRule(RulesItem4Ray rules, V2rayConfig v2rayConfig)
private int GenRoutingUserRule(RulesItem4Ray? rules, V2rayConfig v2rayConfig)
{
try
{
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/Handler/ShareHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ private static ProfileItem ResolveHysteria2(string result)
item.address = url.IdnHost;
item.port = url.Port;
item.remarks = url.GetComponents(UriComponents.Fragment, UriFormat.Unescaped);
item.id = Utils.UrlDecode(url.UserInfo);
item.id = Utils.UrlDecode(url.UserInfo);

var query = Utils.ParseQueryString(url.Query);
ResolveStdTransport(query, ref item);
Expand Down

0 comments on commit d76679c

Please sign in to comment.