Commit c525dda7 authored by justcoding121's avatar justcoding121

let users change timeout minutes

parent e4dfa442
......@@ -235,7 +235,7 @@ namespace Titanium.Web.Proxy.Helpers
try
{
var cutOff = DateTime.Now.AddSeconds(-60);
var cutOff = DateTime.Now.AddMinutes(-1 * ProxyServer.CertificateCacheTimeOutMinutes);
var outdated = certificateCache
.Where(x => x.Value.LastAccess < cutOff)
......
......@@ -206,7 +206,7 @@ namespace Titanium.Web.Proxy.Network
await connectionAccessLock.WaitAsync();
try
{
var cutOff = DateTime.Now.AddSeconds(-60);
var cutOff = DateTime.Now.AddMinutes(-1 * ProxyServer.ConnectionCacheTimeOutMinutes);
connectionCache
.SelectMany(x => x.Value)
......
......@@ -22,6 +22,8 @@ namespace Titanium.Web.Proxy
static ProxyServer()
{
ProxyEndPoints = new List<ProxyEndPoint>();
ConnectionCacheTimeOutMinutes = 3;
CertificateCacheTimeOutMinutes = 60;
}
private static CertificateManager CertManager { get; set; }
......@@ -33,6 +35,16 @@ namespace Titanium.Web.Proxy
public static string RootCertificateName { get; set; }
public static bool Enable100ContinueBehaviour { get; set; }
/// <summary>
/// Minutes TCP connection cache to servers to be kept alive when in idle state
/// </summary>
public static int ConnectionCacheTimeOutMinutes { get; set; }
/// <summary>
/// Minutes certificates should be kept in cache when not used
/// </summary>
public static int CertificateCacheTimeOutMinutes { get; set; }
public static event Func<object, SessionEventArgs, Task> BeforeRequest;
public static event Func<object, SessionEventArgs, Task> BeforeResponse;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment