修改*号的含义

This commit is contained in:
xljiulang 2021-07-22 21:02:16 +08:00
parent 436e7cb398
commit 2850f30516
2 changed files with 3 additions and 2 deletions

View File

@ -5,6 +5,7 @@ namespace FastGithub
{ {
/// <summary> /// <summary>
/// 域名匹配 /// 域名匹配
/// *表示除.之外任意0到多个字符
/// </summary> /// </summary>
public class DomainMatch : IComparable<DomainMatch> public class DomainMatch : IComparable<DomainMatch>
{ {
@ -18,7 +19,7 @@ namespace FastGithub
public DomainMatch(string domainPattern) public DomainMatch(string domainPattern)
{ {
this.domainPattern = domainPattern; this.domainPattern = domainPattern;
var regexPattern = Regex.Escape(domainPattern).Replace(@"\*", ".*"); var regexPattern = Regex.Escape(domainPattern).Replace(@"\*", @"[^\.]*");
this.regex = new Regex($"^{regexPattern}$", RegexOptions.IgnoreCase); this.regex = new Regex($"^{regexPattern}$", RegexOptions.IgnoreCase);
} }

View File

@ -8,7 +8,7 @@
"IPAddress": "114.114.114.114", "IPAddress": "114.114.114.114",
"Port": 53 "Port": 53
}, },
"DomainConfigs": { // *0 "DomainConfigs": { // *.0
"github.com": { "github.com": {
"TlsSni": false, // tlsSNI "TlsSni": false, // tlsSNI
"TlsSniPattern": null, // SNI@domain @ipadressip @random "TlsSniPattern": null, // SNI@domain @ipadressip @random