Commit c094e73e authored by ilushka85's avatar ilushka85

cleanup old code

parent 30501546
...@@ -18,10 +18,10 @@ namespace Titanium.Web.Proxy ...@@ -18,10 +18,10 @@ namespace Titanium.Web.Proxy
/// </summary> /// </summary>
public partial class ProxyServer : IDisposable public partial class ProxyServer : IDisposable
{ {
public ConcurrentQueue<ExternalProxy> CustomUpStreamHttpProxies{ get; set; } public ConcurrentQueue<ExternalProxy> CustomUpStreamHttpProxies { get; set; }
public Func<ConcurrentQueue<ExternalProxy>, ExternalProxy> GetCustomUpStreamHttpProxyFunc = null; public Func<ExternalProxy> GetCustomUpStreamHttpProxyFunc = null;
public ConcurrentQueue<ExternalProxy> CustomUpStreamHttpsProxies { get; set; } public ConcurrentQueue<ExternalProxy> CustomUpStreamHttpsProxies { get; set; }
public Func<ConcurrentQueue<ExternalProxy>, ExternalProxy> GetCustomUpStreamHttpsProxyFunc = null; public Func<ExternalProxy> GetCustomUpStreamHttpsProxyFunc = null;
/// <summary> /// <summary>
...@@ -386,11 +386,11 @@ namespace Titanium.Web.Proxy ...@@ -386,11 +386,11 @@ namespace Titanium.Web.Proxy
} }
if (tcpClient != null) if (tcpClient != null)
{ {
Task.Run(async () => Task.Run(async () =>
{ {
try try
{ {
if (endPoint.GetType() == typeof(TransparentProxyEndPoint)) if (endPoint.GetType() == typeof(TransparentProxyEndPoint))
{ {
await HandleClient(endPoint as TransparentProxyEndPoint, tcpClient); await HandleClient(endPoint as TransparentProxyEndPoint, tcpClient);
...@@ -399,14 +399,14 @@ namespace Titanium.Web.Proxy ...@@ -399,14 +399,14 @@ namespace Titanium.Web.Proxy
{ {
ExternalProxy externalHttpProxy = null; ExternalProxy externalHttpProxy = null;
if (GetCustomUpStreamHttpProxyFunc != null) if (GetCustomUpStreamHttpProxyFunc != null)
externalHttpProxy = GetCustomUpStreamHttpProxyFunc(CustomUpStreamHttpProxies); externalHttpProxy = GetCustomUpStreamHttpProxyFunc();
ExternalProxy externalHttpsProxy = null; ExternalProxy externalHttpsProxy = null;
if (GetCustomUpStreamHttpsProxyFunc != null) if (GetCustomUpStreamHttpsProxyFunc != null)
externalHttpsProxy = GetCustomUpStreamHttpsProxyFunc(CustomUpStreamHttpsProxies); externalHttpsProxy = GetCustomUpStreamHttpsProxyFunc();
await HandleClient(endPoint as ExplicitProxyEndPoint, tcpClient, externalHttpProxy, externalHttpsProxy); await HandleClient(endPoint as ExplicitProxyEndPoint, tcpClient, externalHttpProxy, externalHttpsProxy);
} }
} }
finally finally
{ {
......
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