mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-23 08:43:50 +02:00
Use user set proxy for downloading updates (#898)
This commit is contained in:
@@ -110,6 +110,8 @@ namespace VRCX
|
|||||||
#pragma warning disable SYSLIB0014 // Type or member is obsolete
|
#pragma warning disable SYSLIB0014 // Type or member is obsolete
|
||||||
client = new WebClient();
|
client = new WebClient();
|
||||||
#pragma warning restore SYSLIB0014 // Type or member is obsolete
|
#pragma warning restore SYSLIB0014 // Type or member is obsolete
|
||||||
|
if (WebApi.ProxySet)
|
||||||
|
client.Proxy = WebApi.Proxy;
|
||||||
client.Headers.Add("user-agent", Program.Version);
|
client.Headers.Add("user-agent", Program.Version);
|
||||||
DownloadProgress = 0;
|
DownloadProgress = 0;
|
||||||
DownloadSize = size;
|
DownloadSize = size;
|
||||||
|
|||||||
@@ -81,7 +81,15 @@ namespace VRCX
|
|||||||
|
|
||||||
private static string DownloadFile(string fileUrl)
|
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
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user