Commit c525dda7 authored by justcoding121's avatar justcoding121

let users change timeout minutes

parent e4dfa442
...@@ -235,7 +235,7 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -235,7 +235,7 @@ namespace Titanium.Web.Proxy.Helpers
try try
{ {
var cutOff = DateTime.Now.AddSeconds(-60); var cutOff = DateTime.Now.AddMinutes(-1 * ProxyServer.CertificateCacheTimeOutMinutes);
var outdated = certificateCache var outdated = certificateCache
.Where(x => x.Value.LastAccess < cutOff) .Where(x => x.Value.LastAccess < cutOff)
......
...@@ -206,7 +206,7 @@ namespace Titanium.Web.Proxy.Network ...@@ -206,7 +206,7 @@ namespace Titanium.Web.Proxy.Network
await connectionAccessLock.WaitAsync(); await connectionAccessLock.WaitAsync();
try try
{ {
var cutOff = DateTime.Now.AddSeconds(-60); var cutOff = DateTime.Now.AddMinutes(-1 * ProxyServer.ConnectionCacheTimeOutMinutes);
connectionCache connectionCache
.SelectMany(x => x.Value) .SelectMany(x => x.Value)
......
...@@ -21,7 +21,9 @@ namespace Titanium.Web.Proxy ...@@ -21,7 +21,9 @@ namespace Titanium.Web.Proxy
static ProxyServer() static ProxyServer()
{ {
ProxyEndPoints = new List<ProxyEndPoint>(); ProxyEndPoints = new List<ProxyEndPoint>();
ConnectionCacheTimeOutMinutes = 3;
CertificateCacheTimeOutMinutes = 60;
} }
private static CertificateManager CertManager { get; set; } private static CertificateManager CertManager { get; set; }
...@@ -32,6 +34,16 @@ namespace Titanium.Web.Proxy ...@@ -32,6 +34,16 @@ namespace Titanium.Web.Proxy
public static string RootCertificateIssuerName { get; set; } public static string RootCertificateIssuerName { get; set; }
public static string RootCertificateName { get; set; } public static string RootCertificateName { get; set; }
public static bool Enable100ContinueBehaviour { 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> BeforeRequest;
public static event Func<object, SessionEventArgs, Task> BeforeResponse; 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