Skip to content

Commit

Permalink
📃 Exclude @cn from PAC proxied list
Browse files Browse the repository at this point in the history
- PAC proxied list only contains domain names from geolocation-!cn without a `cn` attribute
  • Loading branch information
database64128 committed Oct 11, 2020
1 parent 90d90f7 commit 2002c29
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions shadowsocks-csharp/Controller/Service/GeositeUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,18 @@ public static class GeositeUpdater
private static HttpClient httpClient;
private static readonly string GEOSITE_URL = "https://github.com/v2fly/domain-list-community/raw/release/dlc.dat";
private static readonly string GEOSITE_SHA256SUM_URL = "https://github.com/v2fly/domain-list-community/raw/release/dlc.dat.sha256sum";
private static readonly DomainObject.Types.Attribute geositeExcludeAttribute;
private static byte[] geositeDB;

public static readonly Dictionary<string, IList<DomainObject>> Geosites = new Dictionary<string, IList<DomainObject>>();

static GeositeUpdater()
{
//socketsHttpHandler = new SocketsHttpHandler();
//httpClient = new HttpClient(socketsHttpHandler);

geositeExcludeAttribute = new DomainObject.Types.Attribute
{
Key = "cn",
BoolValue = true
};
if (File.Exists(DATABASE_PATH) && new FileInfo(DATABASE_PATH).Length > 0)
{
geositeDB = File.ReadAllBytes(DATABASE_PATH);
Expand Down Expand Up @@ -241,6 +244,9 @@ private static List<string> GeositeToGFWListBlack(IList<DomainObject> domains)
List<string> ret = new List<string>(domains.Count + 100);// 100 overhead
foreach (var d in domains)
{
if (d.Attribute.Contains(geositeExcludeAttribute))
continue;

string domain = d.Value;

switch (d.Type)
Expand Down

0 comments on commit 2002c29

Please sign in to comment.