Commit b1aea826 authored by justcoding121's avatar justcoding121

#466 disable socket reuse for linux

parent 51a8e576
......@@ -23,6 +23,9 @@ namespace Titanium.Web.Proxy.Helpers
/// <returns></returns>
private static readonly Lazy<bool> isRunningOnWindows
= new Lazy<bool>(() => RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
private static readonly Lazy<bool> isRunningOnLinux
= new Lazy<bool>(() => RuntimeInformation.IsOSPlatform(OSPlatform.Linux));
#endif
/// <summary>
......@@ -30,6 +33,12 @@ private static readonly Lazy<bool> isRunningOnWindows
/// </summary>
internal static bool IsRunningOnMono => isRunningOnMono.Value;
#if NETSTANDARD2_0
internal static bool IsLinux => isRunningOnLinux.Value;
#else
internal static bool IsLinux => !IsWindows;
#endif
#if NETSTANDARD2_0
internal static bool IsWindows => isRunningOnWindows.Value;
#else
......
......@@ -109,6 +109,12 @@ namespace Titanium.Web.Proxy
systemProxySettingsManager = new SystemProxyManager();
}
//linux have bug with socket reuse
if (!RunTime.IsLinux)
{
ReuseSocket = true;
}
CertificateManager = new CertificateManager(rootCertificateName, rootCertificateIssuerName,
userTrustRootCertificate, machineTrustRootCertificate, trustRootCertificateAsAdmin, ExceptionFunc);
}
......@@ -194,9 +200,9 @@ namespace Titanium.Web.Proxy
/// <summary>
/// Should we resues client/server tcp sockets.
/// Default is true.
/// Default is true (false for linux due to bug in .Net core).
/// </summary>
public bool ReuseSocket { get; set; } = true;
public bool ReuseSocket { get; set; }
/// <summary>
/// Total number of active client connections.
......
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