Browse Source

use local port in gfwlist updater

tags/2.3
clowwindy 10 years ago
parent
commit
8c8c947356
2 changed files with 4 additions and 3 deletions
  1. +3
    -2
      shadowsocks-csharp/Controller/GfwListUpdater.cs
  2. +1
    -1
      shadowsocks-csharp/Controller/ShadowsocksController.cs

+ 3
- 2
shadowsocks-csharp/Controller/GfwListUpdater.cs View File

@@ -6,6 +6,7 @@ using System.IO;
using Shadowsocks.Properties; using Shadowsocks.Properties;
using SimpleJson; using SimpleJson;
using Shadowsocks.Util; using Shadowsocks.Util;
using Shadowsocks.Model;
namespace Shadowsocks.Controller namespace Shadowsocks.Controller
{ {
@@ -42,10 +43,10 @@ namespace Shadowsocks.Controller
} }
} }
public void UpdatePACFromGFWList()
public void UpdatePACFromGFWList(Configuration config)
{ {
WebClient http = new WebClient(); WebClient http = new WebClient();
http.Proxy = new WebProxy(IPAddress.Loopback.ToString(), 8123);
http.Proxy = new WebProxy(IPAddress.Loopback.ToString(), config.localPort);
http.DownloadStringCompleted += http_DownloadStringCompleted; http.DownloadStringCompleted += http_DownloadStringCompleted;
http.DownloadStringAsync(new Uri(GFWLIST_URL)); http.DownloadStringAsync(new Uri(GFWLIST_URL));
} }


+ 1
- 1
shadowsocks-csharp/Controller/ShadowsocksController.cs View File

@@ -178,7 +178,7 @@ namespace Shadowsocks.Controller
{ {
if (gfwListUpdater != null) if (gfwListUpdater != null)
{ {
gfwListUpdater.UpdatePACFromGFWList();
gfwListUpdater.UpdatePACFromGFWList(_config);
} }
} }


Loading…
Cancel
Save