From 17c499c52577e96f2da2171cf673be9e12b0b88d Mon Sep 17 00:00:00 2001 From: Stzx Date: Tue, 27 Aug 2019 20:44:20 +0800 Subject: [PATCH] Modify PAC request behavior Update the PAC file using the proxy channel only when proxy mode is enabled. --- shadowsocks-csharp/Controller/Service/GfwListUpdater.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/shadowsocks-csharp/Controller/Service/GfwListUpdater.cs b/shadowsocks-csharp/Controller/Service/GfwListUpdater.cs index 387e5863..06c27961 100644 --- a/shadowsocks-csharp/Controller/Service/GfwListUpdater.cs +++ b/shadowsocks-csharp/Controller/Service/GfwListUpdater.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Net; @@ -91,7 +91,10 @@ namespace Shadowsocks.Controller { Logging.Info($"Checking GFWList from {GFWLIST_URL}"); WebClient http = new WebClient(); - http.Proxy = new WebProxy(IPAddress.Loopback.ToString(), config.localPort); + if (config.enabled) + { + http.Proxy = new WebProxy(IPAddress.Loopback.ToString(), config.localPort); + } http.DownloadStringCompleted += http_DownloadStringCompleted; http.DownloadStringAsync(new Uri(GFWLIST_URL)); }