wabbajack/Wabbajack.Common/Http/ClientFactory.cs
Timothy Baldridge a1e911669a
Youtube Downloader (#596)
* Can download audio tracks from Youtube, re-encoding to XWM in the process
2020-03-03 14:53:29 -07:00

26 lines
833 B
C#

using System;
using System.Net;
using SysHttp = System.Net.Http;
namespace Wabbajack.Common.Http
{
public static class ClientFactory
{
private static SysHttp.SocketsHttpHandler _socketsHandler { get; }
public static SysHttp.HttpClient Client { get; }
internal static CookieContainer Cookies { get; }
static ClientFactory()
{
Cookies = new CookieContainer();
_socketsHandler = new SysHttp.SocketsHttpHandler
{
CookieContainer = Cookies,
MaxConnectionsPerServer = 20,
PooledConnectionLifetime = TimeSpan.FromMilliseconds(100),
PooledConnectionIdleTimeout = TimeSpan.FromMilliseconds(100)
};
Client = new SysHttp.HttpClient(_socketsHandler);
}
}
}