diff --git a/shadowsocks-csharp/Controller/Service/GeositeUpdater.cs b/shadowsocks-csharp/Controller/Service/GeositeUpdater.cs index ab093d4f..a31001ac 100644 --- a/shadowsocks-csharp/Controller/Service/GeositeUpdater.cs +++ b/shadowsocks-csharp/Controller/Service/GeositeUpdater.cs @@ -167,7 +167,10 @@ var __RULES__ = {JsonConvert.SerializeObject(gfwLines, Formatting.Indented)}; private static List ParseToValidList(IList domains) { - List ret = new List(domains.Count + 100); // 100 overhead + List ret = new List(domains.Count + 100)// 100 overhead + { + "/.*/" // match any domain, so all non-cn domain go through proxy + }; foreach (var d in domains) { string domain = d.Value; @@ -175,17 +178,17 @@ var __RULES__ = {JsonConvert.SerializeObject(gfwLines, Formatting.Indented)}; switch (d.Type) { case DomainObject.Types.Type.Plain: - ret.Add(domain); + ret.Add($"@@{domain}"); break; case DomainObject.Types.Type.Regex: - ret.Add($"/{domain}/"); + ret.Add($"@@/{domain}/"); break; case DomainObject.Types.Type.Domain: - ret.Add($"||{domain}"); + ret.Add($"@@||{domain}"); break; case DomainObject.Types.Type.Full: - ret.Add($"|http://{domain}"); - ret.Add($"|https://{domain}"); + ret.Add($"@@|http://{domain}"); + ret.Add($"@@|https://{domain}"); break; } } diff --git a/shadowsocks-csharp/Data/abp.js b/shadowsocks-csharp/Data/abp.js index 58cd7aa2..cea08514 100644 --- a/shadowsocks-csharp/Data/abp.js +++ b/shadowsocks-csharp/Data/abp.js @@ -786,6 +786,10 @@ function FindProxyForURL(url, host) { if (userrulesMatcher.matchesAny(url, host) instanceof WhitelistFilter) { return direct; } + // Hack for Geosite, it provides a whitelist... + if (defaultMatcher.matchesAny(url, host) instanceof WhitelistFilter) { + return direct; + } if (defaultMatcher.matchesAny(url, host) instanceof BlockingFilter) { return proxy; }