mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
26 lines
820 B
C#
26 lines
820 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; }
|
|||
|
internal static SysHttp.HttpClient Client { get; }
|
|||
|
internal static CookieContainer Cookies { get; }
|
|||
|
|
|||
|
static ClientFactory()
|
|||
|
{
|
|||
|
Cookies = new CookieContainer();
|
|||
|
_socketsHandler = new SysHttp.SocketsHttpHandler
|
|||
|
{
|
|||
|
CookieContainer = Cookies,
|
|||
|
MaxConnectionsPerServer = 8,
|
|||
|
PooledConnectionLifetime = TimeSpan.FromSeconds(2),
|
|||
|
PooledConnectionIdleTimeout = TimeSpan.FromSeconds(2)
|
|||
|
};
|
|||
|
Client = new SysHttp.HttpClient(_socketsHandler);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|