Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom GFWListUrl defined in config file #2728

Merged
merged 1 commit into from
Dec 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions shadowsocks-csharp/Controller/Service/GfwListUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,13 @@ private static string MergePACFile(string gfwListResult)

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)
{
Expand All @@ -101,7 +107,7 @@ public void UpdatePACFromGFWList(Configuration config)
config.localPort);
}
http.DownloadStringCompleted += http_DownloadStringCompleted;
http.DownloadStringAsync(new Uri(GFWLIST_URL));
http.DownloadStringAsync(new Uri(gfwListUrl));
}

public static List<string> ParseBase64ToValidList(string response)
Expand Down
1 change: 1 addition & 0 deletions shadowsocks-csharp/Model/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class Configuration
public int localPort;
public bool portableMode = true;
public string pacUrl;
public string gfwListUrl;
public bool useOnlinePac;
public bool secureLocalPac = true;
public bool availabilityStatistics;
Expand Down