diff --git a/shadowsocks-csharp/Controller/Service/GfwListUpdater.cs b/shadowsocks-csharp/Controller/Service/GfwListUpdater.cs index b3f00f5b..38044315 100644 --- a/shadowsocks-csharp/Controller/Service/GfwListUpdater.cs +++ b/shadowsocks-csharp/Controller/Service/GfwListUpdater.cs @@ -90,7 +90,13 @@ var __RULES__ = {JsonConvert.SerializeObject(gfwLines, Formatting.Indented)}; public void UpdatePACFromGFWList(Configuration config) { - Logging.Info($"Checking GFWList from {GFWLIST_URL}"); + string gfwListUrl = GFWLIST_URL; + if (!string.IsNullOrWhiteSpace(config.gfwListUrl)) + { + Logging.Info("Found custom GFWListURL in config file"); + gfwListUrl = config.gfwListUrl; + } + Logging.Info($"Checking GFWList from {gfwListUrl}"); WebClient http = new WebClient(); if (config.enabled) { @@ -101,7 +107,7 @@ var __RULES__ = {JsonConvert.SerializeObject(gfwLines, Formatting.Indented)}; config.localPort); } http.DownloadStringCompleted += http_DownloadStringCompleted; - http.DownloadStringAsync(new Uri(GFWLIST_URL)); + http.DownloadStringAsync(new Uri(gfwListUrl)); } public static List ParseBase64ToValidList(string response) diff --git a/shadowsocks-csharp/Model/Configuration.cs b/shadowsocks-csharp/Model/Configuration.cs index 0cf2f90c..e8aad2d5 100644 --- a/shadowsocks-csharp/Model/Configuration.cs +++ b/shadowsocks-csharp/Model/Configuration.cs @@ -25,6 +25,7 @@ namespace Shadowsocks.Model public bool portableMode = true; public bool showPluginOutput; public string pacUrl; + public string gfwListUrl; public bool useOnlinePac; public bool secureLocalPac = true; public bool availabilityStatistics;