Use user set proxy for downloading updates (#898)

This commit is contained in:
Nekromateion
2024-09-10 22:38:06 +02:00
committed by GitHub
parent 5bc405e166
commit 4b78eca7ab
2 changed files with 11 additions and 1 deletions

View File

@@ -110,6 +110,8 @@ namespace VRCX
#pragma warning disable SYSLIB0014 // Type or member is obsolete
client = new WebClient();
#pragma warning restore SYSLIB0014 // Type or member is obsolete
if (WebApi.ProxySet)
client.Proxy = WebApi.Proxy;
client.Headers.Add("user-agent", Program.Version);
DownloadProgress = 0;
DownloadSize = size;

View File

@@ -81,7 +81,15 @@ namespace VRCX
private static string DownloadFile(string fileUrl)
{
HttpClient client = new HttpClient();
HttpClientHandler handler = new HttpClientHandler();
if(WebApi.ProxySet)
{
handler.Proxy = WebApi.Proxy;
handler.UseProxy = true;
}
HttpClient client = new HttpClient(handler);
try
{