Implement proxy-server launch argument

Grab proxy-server from launch arguments to match chromium getting it.
This commit is contained in:
Nekromateion
2024-06-16 07:06:02 +02:00
committed by Natsumi
parent 782c2cdd9e
commit 8740905a08
3 changed files with 16 additions and 3 deletions

View File

@@ -11,7 +11,8 @@ namespace VRCX
class ImageCache
{
private static readonly string cacheLocation = Path.Combine(Program.AppDataDirectory, "ImageCache");
private static readonly HttpClient httpClient = new HttpClient();
private static readonly HttpClientHandler httpClientHandler = new HttpClientHandler(){ Proxy = StartupArgs.Proxy };
private static readonly HttpClient httpClient = new HttpClient(httpClientHandler);
private static readonly List<string> _imageHosts =
[
"api.vrchat.cloud",
@@ -53,8 +54,7 @@ namespace VRCX
{
{ "Cookie", cookieString },
{ "User-Agent", Program.Version }
},
}
};
using (var response = await httpClient.SendAsync(request))
{