From c046a32f05f79941d8b4e9c7f397eefaaa0171d0 Mon Sep 17 00:00:00 2001 From: Jehonathan Thomas Date: Fri, 19 May 2017 12:38:43 -0400 Subject: [PATCH 1/2] already supported --- README.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b7e366ee7..f7ae16734 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,7 @@ Features * Safely relays Web Socket requests over HTTP * Support mutual SSL authentication * Fully asynchronous proxy -* Supports proxy authentication - +* Supports proxy authentication & automatic proxy detection Usage ===== @@ -204,10 +203,8 @@ public Task OnCertificateSelection(object sender, CertificateSelectionEventArgs ``` Future road map (Pull requests are welcome!) ============ +* Implement Kerberos/NTLM authentication over HTTP protocols for windows domain * Support Server Name Indication (SNI) for transparent endpoints * Support HTTP 2.0 -* Support upstream AutoProxy detection * Support SOCKS protocol -* Implement Kerberos/NTLM authentication over HTTP protocols for windows domain - From 2260a89e1783ea518fdf99ecb79f784bd3d90f92 Mon Sep 17 00:00:00 2001 From: "PDR\\jehonathan.thomas" Date: Fri, 19 May 2017 16:22:05 -0400 Subject: [PATCH 2/2] #242 Fix external proxy --- Titanium.Web.Proxy/Models/ExternalProxy.cs | 2 +- .../Network/Tcp/TcpConnectionFactory.cs | 33 +++++++++++++++++-- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/Titanium.Web.Proxy/Models/ExternalProxy.cs b/Titanium.Web.Proxy/Models/ExternalProxy.cs index e1516a477..5922c3a47 100644 --- a/Titanium.Web.Proxy/Models/ExternalProxy.cs +++ b/Titanium.Web.Proxy/Models/ExternalProxy.cs @@ -21,7 +21,7 @@ public class ExternalProxy /// /// Bypass this proxy for connections to localhost? /// - public bool BypassForLocalhost { get; set; } + public bool BypassLocalhost { get; set; } /// /// Username. diff --git a/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs b/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs index 4567dff61..7940afb19 100644 --- a/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs +++ b/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs @@ -39,10 +39,37 @@ internal async Task CreateClient(ProxyServer server, TcpClient client; CustomBufferedStream stream; - bool isLocalhost = (externalHttpsProxy != null || externalHttpProxy != null) && NetworkHelper.IsLocalIpAddress(remoteHostName); + + bool useHttpProxy = false; + + //check if external proxy is set for HTTP + if (!isHttps && externalHttpProxy != null + && externalHttpProxy.HostName != remoteHostName) + { + useHttpProxy = true; + + //check if we need to ByPass + if (externalHttpProxy.BypassLocalhost + && NetworkHelper.IsLocalIpAddress(remoteHostName)) + { + useHttpProxy = false; + } + } - bool useHttpsProxy = externalHttpsProxy != null && externalHttpsProxy.HostName != remoteHostName && externalHttpsProxy.BypassForLocalhost && !isLocalhost; - bool useHttpProxy = externalHttpProxy != null && externalHttpProxy.HostName != remoteHostName && externalHttpProxy.BypassForLocalhost && !isLocalhost; + bool useHttpsProxy = false; + //check if external proxy is set for HTTPS + if (isHttps && externalHttpsProxy != null + && externalHttpsProxy.HostName != remoteHostName) + { + useHttpsProxy = true; + + //check if we need to ByPass + if (externalHttpsProxy.BypassLocalhost + && NetworkHelper.IsLocalIpAddress(remoteHostName)) + { + useHttpsProxy = false; + } + } if (isHttps) {