mirror of
https://github.com/2dust/v2rayN.git
synced 2025-08-23 19:36:55 +00:00
更新订阅时,支持当前的代理连接。
This commit is contained in:
parent
fe15fde594
commit
23f8533547
2 changed files with 16 additions and 2 deletions
|
@ -9,6 +9,7 @@ using v2rayN.Handler;
|
|||
using v2rayN.HttpProxyHandler;
|
||||
using v2rayN.Mode;
|
||||
using v2rayN.Base;
|
||||
using System.Net;
|
||||
|
||||
namespace v2rayN.Forms
|
||||
{
|
||||
|
@ -1366,7 +1367,14 @@ namespace v2rayN.Forms
|
|||
AppendText(true, args.GetException().Message);
|
||||
};
|
||||
|
||||
downloadHandle3.WebDownloadString(url);
|
||||
IWebProxy proxy = null;
|
||||
|
||||
if (config.index >= 0 && config.vmess.Count > 0)
|
||||
{
|
||||
proxy = new WebProxy(Global.Loopback, config.GetLocalPort(Global.InboundHttp));
|
||||
}
|
||||
|
||||
downloadHandle3.WebDownloadString(url, proxy);
|
||||
AppendText(false, $"{hashCode}{UIRes.I18N("MsgStartGettingSubscriptions")}");
|
||||
}
|
||||
|
||||
|
|
|
@ -188,7 +188,7 @@ namespace v2rayN.Handler
|
|||
/// DownloadString
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
public void WebDownloadString(string url)
|
||||
public void WebDownloadString(string url, IWebProxy proxy = null)
|
||||
{
|
||||
string source = string.Empty;
|
||||
try
|
||||
|
@ -196,6 +196,12 @@ namespace v2rayN.Handler
|
|||
SetSecurityProtocol();
|
||||
|
||||
WebClientEx ws = new WebClientEx();
|
||||
|
||||
if (proxy != null)
|
||||
{
|
||||
ws.Proxy = proxy;
|
||||
}
|
||||
|
||||
ws.DownloadStringCompleted += Ws_DownloadStringCompleted;
|
||||
ws.DownloadStringAsync(new Uri(url));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue