using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Net;
+using System.Net.Cache;
using System.Net.Http;
using System.Text;
using System.Threading;
Networking.initialized = true;
ServicePointManager.Expect100Continue = false;
+ WebRequest.DefaultCachePolicy = new RequestCachePolicy(RequestCacheLevel.Default);
}
public static void SetWebProxy(ProxyType proxyType, string proxyAddress, int proxyPort,
var oldClient = Interlocked.Exchange(ref globalHttpClient, newClient);
oldClient.Dispose();
- if (WebProxyChanged != null)
- WebProxyChanged(null, e);
+ WebProxyChanged?.Invoke(null, e);
}
private class ForceIPv4Handler : DelegatingHandler