Skip to content
This repository was archived by the owner on Jul 9, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
=====
Expand Down Expand Up @@ -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


2 changes: 1 addition & 1 deletion Titanium.Web.Proxy/Models/ExternalProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class ExternalProxy
/// <summary>
/// Bypass this proxy for connections to localhost?
/// </summary>
public bool BypassForLocalhost { get; set; }
public bool BypassLocalhost { get; set; }

/// <summary>
/// Username.
Expand Down
33 changes: 30 additions & 3 deletions Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,37 @@ internal async Task<TcpConnection> 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)
{
Expand Down