Unverified Commit 347fa30b authored by justcoding121's avatar justcoding121 Committed by GitHub

Merge pull request #419 from justcoding121/master

Beta
parents 79542b52 7ac94c88
...@@ -3,6 +3,7 @@ using System.Net; ...@@ -3,6 +3,7 @@ using System.Net;
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
using Titanium.Web.Proxy.Helpers; using Titanium.Web.Proxy.Helpers;
using Titanium.Web.Proxy.Helpers.WinHttp; using Titanium.Web.Proxy.Helpers.WinHttp;
using Titanium.Web.Proxy.Models;
namespace Titanium.Web.Proxy.UnitTests namespace Titanium.Web.Proxy.UnitTests
{ {
......
...@@ -11,11 +11,11 @@ namespace Titanium.Web.Proxy ...@@ -11,11 +11,11 @@ namespace Titanium.Web.Proxy
/// <summary> /// <summary>
/// Call back to override server certificate validation /// Call back to override server certificate validation
/// </summary> /// </summary>
/// <param name="sender"></param> /// <param name="sender">The sender object.</param>
/// <param name="certificate"></param> /// <param name="certificate">The remote certificate.</param>
/// <param name="chain"></param> /// <param name="chain">The certificate chain.</param>
/// <param name="sslPolicyErrors"></param> /// <param name="sslPolicyErrors">Ssl policy errors</param>
/// <returns></returns> /// <returns>Return true if valid certificate.</returns>
internal bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, internal bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain,
SslPolicyErrors sslPolicyErrors) SslPolicyErrors sslPolicyErrors)
{ {
...@@ -47,11 +47,11 @@ namespace Titanium.Web.Proxy ...@@ -47,11 +47,11 @@ namespace Titanium.Web.Proxy
/// <summary> /// <summary>
/// Call back to select client certificate used for mutual authentication /// Call back to select client certificate used for mutual authentication
/// </summary> /// </summary>
/// <param name="sender"></param> /// <param name="sender">The sender.</param>
/// <param name="targetHost"></param> /// <param name="targetHost">The remote hostname.</param>
/// <param name="localCertificates"></param> /// <param name="localCertificates">Selected local certificates by SslStream.</param>
/// <param name="remoteCertificate"></param> /// <param name="remoteCertificate">The remote certificate of server.</param>
/// <param name="acceptableIssuers"></param> /// <param name="acceptableIssuers">The acceptable issues for client certificate as listed by server.</param>
/// <returns></returns> /// <returns></returns>
internal X509Certificate SelectClientCertificate(object sender, string targetHost, internal X509Certificate SelectClientCertificate(object sender, string targetHost,
X509CertificateCollection localCertificates, X509CertificateCollection localCertificates,
......
...@@ -16,7 +16,8 @@ namespace Titanium.Web.Proxy.EventArguments ...@@ -16,7 +16,8 @@ namespace Titanium.Web.Proxy.EventArguments
} }
/// <summary> /// <summary>
/// The server name indication hostname if available. Otherwise the generic certificate hostname of TransparentEndPoint. /// The server name indication hostname if available. Otherwise the generic certificate hostname of
/// TransparentEndPoint.
/// </summary> /// </summary>
public string SniHostName { get; internal set; } public string SniHostName { get; internal set; }
......
...@@ -21,10 +21,10 @@ namespace Titanium.Web.Proxy.EventArguments ...@@ -21,10 +21,10 @@ namespace Titanium.Web.Proxy.EventArguments
/// </summary> /// </summary>
protected readonly int BufferSize; protected readonly int BufferSize;
protected readonly ExceptionHandler ExceptionFunc;
internal readonly CancellationTokenSource CancellationTokenSource; internal readonly CancellationTokenSource CancellationTokenSource;
protected readonly ExceptionHandler ExceptionFunc;
/// <summary> /// <summary>
/// Constructor to initialize the proxy /// Constructor to initialize the proxy
/// </summary> /// </summary>
......
...@@ -35,7 +35,8 @@ namespace Titanium.Web.Proxy.EventArguments ...@@ -35,7 +35,8 @@ namespace Titanium.Web.Proxy.EventArguments
/// </summary> /// </summary>
public bool IsHttpsConnect public bool IsHttpsConnect
{ {
get => isHttpsConnect ?? throw new Exception("The value of this property is known in the BeforeTunnectConnectResponse event"); get => isHttpsConnect ??
throw new Exception("The value of this property is known in the BeforeTunnectConnectResponse event");
internal set => isHttpsConnect = value; internal set => isHttpsConnect = value;
} }
} }
......
using System; using System;
using System.IO; using System.IO;
using System.Linq;
using System.Net; using System.Net;
using System.Net.Security; using System.Net.Security;
using System.Net.Sockets; using System.Net.Sockets;
...@@ -25,9 +24,9 @@ namespace Titanium.Web.Proxy ...@@ -25,9 +24,9 @@ namespace Titanium.Web.Proxy
/// This is called when client is aware of proxy /// This is called when client is aware of proxy
/// So for HTTPS requests client would send CONNECT header to negotiate a secure tcp tunnel via proxy /// So for HTTPS requests client would send CONNECT header to negotiate a secure tcp tunnel via proxy
/// </summary> /// </summary>
/// <param name="endPoint"></param> /// <param name="endPoint">The explicit endpoint.</param>
/// <param name="tcpClient"></param> /// <param name="tcpClient">The client.</param>
/// <returns></returns> /// <returns>The task.</returns>
private async Task HandleClient(ExplicitProxyEndPoint endPoint, TcpClient tcpClient) private async Task HandleClient(ExplicitProxyEndPoint endPoint, TcpClient tcpClient)
{ {
var cancellationTokenSource = new CancellationTokenSource(); var cancellationTokenSource = new CancellationTokenSource();
...@@ -90,7 +89,8 @@ namespace Titanium.Web.Proxy ...@@ -90,7 +89,8 @@ namespace Titanium.Web.Proxy
} }
//send the response //send the response
await clientStreamWriter.WriteResponseAsync(connectArgs.WebSession.Response, cancellationToken: cancellationToken); await clientStreamWriter.WriteResponseAsync(connectArgs.WebSession.Response,
cancellationToken: cancellationToken);
return; return;
} }
...@@ -99,7 +99,8 @@ namespace Titanium.Web.Proxy ...@@ -99,7 +99,8 @@ namespace Titanium.Web.Proxy
await endPoint.InvokeBeforeTunnectConnectResponse(this, connectArgs, ExceptionFunc); await endPoint.InvokeBeforeTunnectConnectResponse(this, connectArgs, ExceptionFunc);
//send the response //send the response
await clientStreamWriter.WriteResponseAsync(connectArgs.WebSession.Response, cancellationToken: cancellationToken); await clientStreamWriter.WriteResponseAsync(connectArgs.WebSession.Response,
cancellationToken: cancellationToken);
return; return;
} }
...@@ -212,7 +213,8 @@ namespace Titanium.Web.Proxy ...@@ -212,7 +213,8 @@ namespace Titanium.Web.Proxy
{ {
// clientStream.Available sbould be at most BufferSize because it is using the same buffer size // clientStream.Available sbould be at most BufferSize because it is using the same buffer size
await clientStream.ReadAsync(data, 0, available, cancellationToken); await clientStream.ReadAsync(data, 0, available, cancellationToken);
await connection.StreamWriter.WriteAsync(data, 0, available, true, cancellationToken); await connection.StreamWriter.WriteAsync(data, 0, available, true,
cancellationToken);
} }
finally finally
{ {
...@@ -220,7 +222,8 @@ namespace Titanium.Web.Proxy ...@@ -220,7 +222,8 @@ namespace Titanium.Web.Proxy
} }
} }
var serverHelloInfo = await SslTools.PeekServerHello(connection.Stream, cancellationToken); var serverHelloInfo =
await SslTools.PeekServerHello(connection.Stream, cancellationToken);
((ConnectResponse)connectArgs.WebSession.Response).ServerHelloInfo = serverHelloInfo; ((ConnectResponse)connectArgs.WebSession.Response).ServerHelloInfo = serverHelloInfo;
} }
...@@ -242,13 +245,22 @@ namespace Titanium.Web.Proxy ...@@ -242,13 +245,22 @@ namespace Titanium.Web.Proxy
{ {
// HTTP/2 Connection Preface // HTTP/2 Connection Preface
string line = await clientStreamReader.ReadLineAsync(cancellationToken); string line = await clientStreamReader.ReadLineAsync(cancellationToken);
if (line != string.Empty) throw new Exception($"HTTP/2 Protocol violation. Empty string expected, '{line}' received"); if (line != string.Empty)
{
throw new Exception($"HTTP/2 Protocol violation. Empty string expected, '{line}' received");
}
line = await clientStreamReader.ReadLineAsync(cancellationToken); line = await clientStreamReader.ReadLineAsync(cancellationToken);
if (line != "SM") throw new Exception($"HTTP/2 Protocol violation. 'SM' expected, '{line}' received"); if (line != "SM")
{
throw new Exception($"HTTP/2 Protocol violation. 'SM' expected, '{line}' received");
}
line = await clientStreamReader.ReadLineAsync(cancellationToken); line = await clientStreamReader.ReadLineAsync(cancellationToken);
if (line != string.Empty) throw new Exception($"HTTP/2 Protocol violation. Empty string expected, '{line}' received"); if (line != string.Empty)
{
throw new Exception($"HTTP/2 Protocol violation. Empty string expected, '{line}' received");
}
//create new connection //create new connection
using (var connection = await GetServerConnection(connectArgs, true, cancellationToken)) using (var connection = await GetServerConnection(connectArgs, true, cancellationToken))
...@@ -268,7 +280,8 @@ namespace Titanium.Web.Proxy ...@@ -268,7 +280,8 @@ namespace Titanium.Web.Proxy
//Now create the request //Now create the request
await HandleHttpSessionRequest(endPoint, tcpClient, clientStream, clientStreamReader, await HandleHttpSessionRequest(endPoint, tcpClient, clientStream, clientStreamReader,
clientStreamWriter, cancellationTokenSource, connectHostname, connectArgs?.WebSession.ConnectRequest); clientStreamWriter, cancellationTokenSource, connectHostname,
connectArgs?.WebSession.ConnectRequest);
} }
catch (ProxyHttpException e) catch (ProxyHttpException e)
{ {
......
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Net.Security; using System.Net.Security;
using System.Security.Authentication; using System.Security.Authentication;
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using StreamExtended; using StreamExtended;
...@@ -13,7 +10,8 @@ namespace Titanium.Web.Proxy.Extensions ...@@ -13,7 +10,8 @@ namespace Titanium.Web.Proxy.Extensions
{ {
internal static class SslExtensions internal static class SslExtensions
{ {
internal static readonly List<SslApplicationProtocol> Http11ProtocolAsList = new List<SslApplicationProtocol> { SslApplicationProtocol.Http11 }; internal static readonly List<SslApplicationProtocol> Http11ProtocolAsList =
new List<SslApplicationProtocol> { SslApplicationProtocol.Http11 };
internal static string GetServerName(this ClientHelloInfo clientHelloInfo) internal static string GetServerName(this ClientHelloInfo clientHelloInfo)
{ {
...@@ -60,14 +58,18 @@ namespace Titanium.Web.Proxy.Extensions ...@@ -60,14 +58,18 @@ namespace Titanium.Web.Proxy.Extensions
return Http11ProtocolAsList; return Http11ProtocolAsList;
} }
internal static Task AuthenticateAsClientAsync(this SslStream sslStream, SslClientAuthenticationOptions option, CancellationToken token) internal static Task AuthenticateAsClientAsync(this SslStream sslStream, SslClientAuthenticationOptions option,
CancellationToken token)
{ {
return sslStream.AuthenticateAsClientAsync(option.TargetHost, option.ClientCertificates, option.EnabledSslProtocols, option.CertificateRevocationCheckMode != X509RevocationMode.NoCheck); return sslStream.AuthenticateAsClientAsync(option.TargetHost, option.ClientCertificates,
option.EnabledSslProtocols, option.CertificateRevocationCheckMode != X509RevocationMode.NoCheck);
} }
internal static Task AuthenticateAsServerAsync(this SslStream sslStream, SslServerAuthenticationOptions options, CancellationToken token) internal static Task AuthenticateAsServerAsync(this SslStream sslStream, SslServerAuthenticationOptions options,
CancellationToken token)
{ {
return sslStream.AuthenticateAsServerAsync(options.ServerCertificate, options.ClientCertificateRequired, options.EnabledSslProtocols, options.CertificateRevocationCheckMode != X509RevocationMode.NoCheck); return sslStream.AuthenticateAsServerAsync(options.ServerCertificate, options.ClientCertificateRequired,
options.EnabledSslProtocols, options.CertificateRevocationCheckMode != X509RevocationMode.NoCheck);
} }
#endif #endif
} }
...@@ -75,7 +77,8 @@ namespace Titanium.Web.Proxy.Extensions ...@@ -75,7 +77,8 @@ namespace Titanium.Web.Proxy.Extensions
#if !NETCOREAPP2_1 #if !NETCOREAPP2_1
internal enum SslApplicationProtocol internal enum SslApplicationProtocol
{ {
Http11, Http2 Http11,
Http2
} }
internal class SslClientAuthenticationOptions internal class SslClientAuthenticationOptions
......
...@@ -35,7 +35,8 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -35,7 +35,8 @@ namespace Titanium.Web.Proxy.Helpers
/// <param name="description">The HTTP status description.</param> /// <param name="description">The HTTP status description.</param>
/// <param name="cancellationToken">Optional cancellation token for this async task.</param> /// <param name="cancellationToken">Optional cancellation token for this async task.</param>
/// <returns>The Task.</returns> /// <returns>The Task.</returns>
internal Task WriteResponseStatusAsync(Version version, int code, string description, CancellationToken cancellationToken) internal Task WriteResponseStatusAsync(Version version, int code, string description,
CancellationToken cancellationToken)
{ {
return WriteLineAsync(Response.CreateResponseLine(version, code, description), cancellationToken); return WriteLineAsync(Response.CreateResponseLine(version, code, description), cancellationToken);
} }
......
...@@ -98,7 +98,8 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -98,7 +98,8 @@ namespace Titanium.Web.Proxy.Helpers
/// <param name="flush"></param> /// <param name="flush"></param>
/// <param name="cancellationToken"></param> /// <param name="cancellationToken"></param>
/// <returns></returns> /// <returns></returns>
internal async Task WriteHeadersAsync(HeaderCollection headers, bool flush = true, CancellationToken cancellationToken = default) internal async Task WriteHeadersAsync(HeaderCollection headers, bool flush = true,
CancellationToken cancellationToken = default)
{ {
foreach (var header in headers) foreach (var header in headers)
{ {
...@@ -121,7 +122,8 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -121,7 +122,8 @@ namespace Titanium.Web.Proxy.Helpers
} }
} }
internal async Task WriteAsync(byte[] data, int offset, int count, bool flush, CancellationToken cancellationToken = default) internal async Task WriteAsync(byte[] data, int offset, int count, bool flush,
CancellationToken cancellationToken = default)
{ {
await WriteAsync(data, offset, count, cancellationToken); await WriteAsync(data, offset, count, cancellationToken);
if (flush) if (flush)
...@@ -202,7 +204,8 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -202,7 +204,8 @@ namespace Titanium.Web.Proxy.Helpers
/// <param name="onCopy"></param> /// <param name="onCopy"></param>
/// <param name="cancellationToken"></param> /// <param name="cancellationToken"></param>
/// <returns></returns> /// <returns></returns>
private async Task CopyBodyChunkedAsync(CustomBinaryReader reader, Action<byte[], int, int> onCopy, CancellationToken cancellationToken) private async Task CopyBodyChunkedAsync(CustomBinaryReader reader, Action<byte[], int, int> onCopy,
CancellationToken cancellationToken)
{ {
while (true) while (true)
{ {
...@@ -242,7 +245,8 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -242,7 +245,8 @@ namespace Titanium.Web.Proxy.Helpers
/// <param name="onCopy"></param> /// <param name="onCopy"></param>
/// <param name="cancellationToken"></param> /// <param name="cancellationToken"></param>
/// <returns></returns> /// <returns></returns>
private async Task CopyBytesFromStream(CustomBinaryReader reader, long count, Action<byte[], int, int> onCopy, CancellationToken cancellationToken) private async Task CopyBytesFromStream(CustomBinaryReader reader, long count, Action<byte[], int, int> onCopy,
CancellationToken cancellationToken)
{ {
var buffer = reader.Buffer; var buffer = reader.Buffer;
long remainingBytes = count; long remainingBytes = count;
...@@ -276,7 +280,8 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -276,7 +280,8 @@ namespace Titanium.Web.Proxy.Helpers
/// <param name="flush"></param> /// <param name="flush"></param>
/// <param name="cancellationToken"></param> /// <param name="cancellationToken"></param>
/// <returns></returns> /// <returns></returns>
protected async Task WriteAsync(RequestResponseBase requestResponse, bool flush = true, CancellationToken cancellationToken = default) protected async Task WriteAsync(RequestResponseBase requestResponse, bool flush = true,
CancellationToken cancellationToken = default)
{ {
var body = requestResponse.CompressBodyAndUpdateContentLength(); var body = requestResponse.CompressBodyAndUpdateContentLength();
await WriteHeadersAsync(requestResponse.Headers, flush, cancellationToken); await WriteHeadersAsync(requestResponse.Headers, flush, cancellationToken);
......
...@@ -44,7 +44,7 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -44,7 +44,7 @@ namespace Titanium.Web.Proxy.Helpers
} }
/// <summary> /// <summary>
/// <see href="https://msdn.microsoft.com/en-us/library/aa366896.aspx"/> /// <see href="https://msdn.microsoft.com/en-us/library/aa366896.aspx" />
/// </summary> /// </summary>
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
internal unsafe struct Tcp6Row internal unsafe struct Tcp6Row
......
...@@ -3,6 +3,7 @@ using System.Collections.Generic; ...@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Titanium.Web.Proxy.Models;
namespace Titanium.Web.Proxy.Helpers namespace Titanium.Web.Proxy.Helpers
{ {
......
using System; namespace Titanium.Web.Proxy.Helpers
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Titanium.Web.Proxy.Helpers
{ {
internal class Ref<T> internal class Ref<T>
{ {
...@@ -21,7 +15,7 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -21,7 +15,7 @@ namespace Titanium.Web.Proxy.Helpers
public override string ToString() public override string ToString()
{ {
T value = Value; var value = Value;
return value == null ? string.Empty : value.ToString(); return value == null ? string.Empty : value.ToString();
} }
......
using System; using System;
using System.Runtime.InteropServices;
#if NETSTANDARD2_0
using System.Runtime.InteropServices;
#endif
namespace Titanium.Web.Proxy.Helpers namespace Titanium.Web.Proxy.Helpers
{ {
/// <summary> /// <summary>
...@@ -19,8 +21,8 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -19,8 +21,8 @@ namespace Titanium.Web.Proxy.Helpers
/// cache for Windows platform check /// cache for Windows platform check
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
private static readonly Lazy<bool> isRunningOnWindows = new Lazy<bool>(() => RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); private static readonly Lazy<bool> isRunningOnWindows
= new Lazy<bool>(() => RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
#endif #endif
/// <summary> /// <summary>
......
using System; using System;
using System.Linq; using System.Linq;
using Microsoft.Win32; using Microsoft.Win32;
using Titanium.Web.Proxy.Models;
// Helper classes for setting system proxy settings // Helper classes for setting system proxy settings
namespace Titanium.Web.Proxy.Helpers namespace Titanium.Web.Proxy.Helpers
{ {
[Flags]
public enum ProxyProtocolType
{
/// <summary>
/// The none
/// </summary>
None = 0,
/// <summary>
/// HTTP
/// </summary>
Http = 1,
/// <summary>
/// HTTPS
/// </summary>
Https = 2,
/// <summary>
/// Both HTTP and HTTPS
/// </summary>
AllHttp = Http | Https
}
internal class HttpSystemProxyValue internal class HttpSystemProxyValue
{ {
......
...@@ -41,7 +41,7 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -41,7 +41,7 @@ namespace Titanium.Web.Proxy.Helpers
if (ipVersion == IpVersion.Ipv4) if (ipVersion == IpVersion.Ipv4)
{ {
NativeMethods.TcpRow* rowPtr = (NativeMethods.TcpRow*)(tcpTable + 4); var rowPtr = (NativeMethods.TcpRow*)(tcpTable + 4);
for (int i = 0; i < rowCount; ++i) for (int i = 0; i < rowCount; ++i)
{ {
...@@ -55,7 +55,7 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -55,7 +55,7 @@ namespace Titanium.Web.Proxy.Helpers
} }
else else
{ {
NativeMethods.Tcp6Row* rowPtr = (NativeMethods.Tcp6Row*)(tcpTable + 4); var rowPtr = (NativeMethods.Tcp6Row*)(tcpTable + 4);
for (int i = 0; i < rowCount; ++i) for (int i = 0; i < rowCount; ++i)
{ {
...@@ -276,9 +276,11 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -276,9 +276,11 @@ namespace Titanium.Web.Proxy.Helpers
//Now async relay all server=>client & client=>server data //Now async relay all server=>client & client=>server data
var sendRelay = var sendRelay =
CopyHttp2FrameAsync(clientStream, serverStream, onDataSend, bufferSize, connectionId, cancellationTokenSource.Token); CopyHttp2FrameAsync(clientStream, serverStream, onDataSend, bufferSize, connectionId,
cancellationTokenSource.Token);
var receiveRelay = var receiveRelay =
CopyHttp2FrameAsync(serverStream, clientStream, onDataReceive, bufferSize, connectionId, cancellationTokenSource.Token); CopyHttp2FrameAsync(serverStream, clientStream, onDataReceive, bufferSize, connectionId,
cancellationTokenSource.Token);
await Task.WhenAny(sendRelay, receiveRelay); await Task.WhenAny(sendRelay, receiveRelay);
cancellationTokenSource.Cancel(); cancellationTokenSource.Cancel();
...@@ -302,7 +304,8 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -302,7 +304,8 @@ namespace Titanium.Web.Proxy.Helpers
int length = (headerBuffer[0] << 16) + (headerBuffer[1] << 8) + headerBuffer[2]; int length = (headerBuffer[0] << 16) + (headerBuffer[1] << 8) + headerBuffer[2];
byte type = headerBuffer[3]; byte type = headerBuffer[3];
byte flags = headerBuffer[4]; byte flags = headerBuffer[4];
int streamId = ((headerBuffer[5] & 0x7f) << 24) + (headerBuffer[6] << 16) + (headerBuffer[7] << 8) + headerBuffer[8]; int streamId = ((headerBuffer[5] & 0x7f) << 24) + (headerBuffer[6] << 16) + (headerBuffer[7] << 8) +
headerBuffer[8];
read = await ForceRead(input, buffer, 0, length, cancellationToken); read = await ForceRead(input, buffer, 0, length, cancellationToken);
if (read != length) if (read != length)
...@@ -321,7 +324,8 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -321,7 +324,8 @@ namespace Titanium.Web.Proxy.Helpers
} }
} }
private static async Task<int> ForceRead(Stream input, byte[] buffer, int offset, int bytesToRead, CancellationToken cancellationToken) private static async Task<int> ForceRead(Stream input, byte[] buffer, int offset, int bytesToRead,
CancellationToken cancellationToken)
{ {
int totalRead = 0; int totalRead = 0;
while (bytesToRead > 0) while (bytesToRead > 0)
......
...@@ -8,7 +8,8 @@ namespace Titanium.Web.Proxy.Http ...@@ -8,7 +8,8 @@ namespace Titanium.Web.Proxy.Http
{ {
internal static class HeaderParser internal static class HeaderParser
{ {
internal static async Task ReadHeaders(CustomBinaryReader reader, HeaderCollection headerCollection, CancellationToken cancellationToken) internal static async Task ReadHeaders(CustomBinaryReader reader, HeaderCollection headerCollection,
CancellationToken cancellationToken)
{ {
string tmpLine; string tmpLine;
while (!string.IsNullOrEmpty(tmpLine = await reader.ReadLineAsync(cancellationToken))) while (!string.IsNullOrEmpty(tmpLine = await reader.ReadLineAsync(cancellationToken)))
......
...@@ -80,7 +80,8 @@ namespace Titanium.Web.Proxy.Http ...@@ -80,7 +80,8 @@ namespace Titanium.Web.Proxy.Http
/// Prepare and send the http(s) request /// Prepare and send the http(s) request
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
internal async Task SendRequest(bool enable100ContinueBehaviour, bool isTransparent, CancellationToken cancellationToken) internal async Task SendRequest(bool enable100ContinueBehaviour, bool isTransparent,
CancellationToken cancellationToken)
{ {
var upstreamProxy = ServerConnection.UpStreamProxy; var upstreamProxy = ServerConnection.UpStreamProxy;
......
using System;
namespace Titanium.Web.Proxy.Models
{
[Flags]
public enum ProxyProtocolType
{
/// <summary>
/// The none
/// </summary>
None = 0,
/// <summary>
/// HTTP
/// </summary>
Http = 1,
/// <summary>
/// HTTPS
/// </summary>
Https = 2,
/// <summary>
/// Both HTTP and HTTPS
/// </summary>
AllHttp = Http | Https
}
}
...@@ -60,13 +60,18 @@ namespace Titanium.Web.Proxy.Network ...@@ -60,13 +60,18 @@ namespace Titanium.Web.Proxy.Network
/// <summary> /// <summary>
///
/// </summary> /// </summary>
/// <param name="rootCertificateName"></param> /// <param name="rootCertificateName"></param>
/// <param name="rootCertificateIssuerName"></param> /// <param name="rootCertificateIssuerName"></param>
/// <param name="userTrustRootCertificate">Should fake HTTPS certificate be trusted by this machine's user certificate store?</param> /// <param name="userTrustRootCertificate">
/// Should fake HTTPS certificate be trusted by this machine's user certificate
/// store?
/// </param>
/// <param name="machineTrustRootCertificate">Should fake HTTPS certificate be trusted by this machine's certificate store?</param> /// <param name="machineTrustRootCertificate">Should fake HTTPS certificate be trusted by this machine's certificate store?</param>
/// <param name="trustRootCertificateAsAdmin">Should we attempt to trust certificates with elevated permissions by prompting for UAC if required?</param> /// <param name="trustRootCertificateAsAdmin">
/// Should we attempt to trust certificates with elevated permissions by
/// prompting for UAC if required?
/// </param>
/// <param name="exceptionFunc"></param> /// <param name="exceptionFunc"></param>
internal CertificateManager(string rootCertificateName, string rootCertificateIssuerName, internal CertificateManager(string rootCertificateName, string rootCertificateIssuerName,
bool userTrustRootCertificate, bool machineTrustRootCertificate, bool trustRootCertificateAsAdmin, bool userTrustRootCertificate, bool machineTrustRootCertificate, bool trustRootCertificateAsAdmin,
...@@ -639,7 +644,10 @@ namespace Titanium.Web.Proxy.Network ...@@ -639,7 +644,10 @@ namespace Titanium.Web.Proxy.Network
/// named as "rootCert.pfx" (and will be saved in proxy dll directory). /// named as "rootCert.pfx" (and will be saved in proxy dll directory).
/// </param> /// </param>
/// <param name="password">Set a password for the .pfx file.</param> /// <param name="password">Set a password for the .pfx file.</param>
/// <param name="overwritePfXFile">true : replace an existing .pfx file if password is incorect or if RootCertificate==null.</param> /// <param name="overwritePfXFile">
/// true : replace an existing .pfx file if password is incorect or if
/// RootCertificate==null.
/// </param>
/// <param name="storageFlag"></param> /// <param name="storageFlag"></param>
/// <returns> /// <returns>
/// true if succeeded, else false. /// true if succeeded, else false.
...@@ -765,9 +773,15 @@ namespace Titanium.Web.Proxy.Network ...@@ -765,9 +773,15 @@ namespace Titanium.Web.Proxy.Network
/// Also makes root certificate trusted based on provided parameters. /// Also makes root certificate trusted based on provided parameters.
/// Note:setting machineTrustRootCertificate to true will force userTrustRootCertificate to true. /// Note:setting machineTrustRootCertificate to true will force userTrustRootCertificate to true.
/// </summary> /// </summary>
/// <param name="userTrustRootCertificate">Should fake HTTPS certificate be trusted by this machine's user certificate store?</param> /// <param name="userTrustRootCertificate">
/// Should fake HTTPS certificate be trusted by this machine's user certificate
/// store?
/// </param>
/// <param name="machineTrustRootCertificate">Should fake HTTPS certificate be trusted by this machine's certificate store?</param> /// <param name="machineTrustRootCertificate">Should fake HTTPS certificate be trusted by this machine's certificate store?</param>
/// <param name="trustRootCertificateAsAdmin">Should we attempt to trust certificates with elevated permissions by prompting for UAC if required?</param> /// <param name="trustRootCertificateAsAdmin">
/// Should we attempt to trust certificates with elevated permissions by
/// prompting for UAC if required?
/// </param>
public void EnsureRootCertificate(bool userTrustRootCertificate, public void EnsureRootCertificate(bool userTrustRootCertificate,
bool machineTrustRootCertificate, bool trustRootCertificateAsAdmin = false) bool machineTrustRootCertificate, bool trustRootCertificateAsAdmin = false)
{ {
......
...@@ -3,7 +3,6 @@ using System.Collections.Generic; ...@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Net; using System.Net;
using System.Net.Security; using System.Net.Security;
using System.Net.Sockets; using System.Net.Sockets;
using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using StreamExtended.Network; using StreamExtended.Network;
...@@ -35,7 +34,8 @@ namespace Titanium.Web.Proxy.Network.Tcp ...@@ -35,7 +34,8 @@ namespace Titanium.Web.Proxy.Network.Tcp
/// <returns></returns> /// <returns></returns>
internal async Task<TcpConnection> CreateClient(string remoteHostName, int remotePort, internal async Task<TcpConnection> CreateClient(string remoteHostName, int remotePort,
List<SslApplicationProtocol> applicationProtocols, Version httpVersion, bool decryptSsl, bool isConnect, List<SslApplicationProtocol> applicationProtocols, Version httpVersion, bool decryptSsl, bool isConnect,
ProxyServer proxyServer, IPEndPoint upStreamEndPoint, ExternalProxy externalProxy, CancellationToken cancellationToken) ProxyServer proxyServer, IPEndPoint upStreamEndPoint, ExternalProxy externalProxy,
CancellationToken cancellationToken)
{ {
bool useUpstreamProxy = false; bool useUpstreamProxy = false;
...@@ -79,7 +79,7 @@ namespace Titanium.Web.Proxy.Network.Tcp ...@@ -79,7 +79,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
var connectRequest = new ConnectRequest var connectRequest = new ConnectRequest
{ {
OriginalUrl = $"{remoteHostName}:{remotePort}", OriginalUrl = $"{remoteHostName}:{remotePort}",
HttpVersion = httpVersion, HttpVersion = httpVersion
}; };
connectRequest.Headers.AddHeader(KnownHeaders.Connection, KnownHeaders.ConnectionKeepAlive); connectRequest.Headers.AddHeader(KnownHeaders.Connection, KnownHeaders.ConnectionKeepAlive);
...@@ -87,7 +87,8 @@ namespace Titanium.Web.Proxy.Network.Tcp ...@@ -87,7 +87,8 @@ namespace Titanium.Web.Proxy.Network.Tcp
if (!string.IsNullOrEmpty(externalProxy.UserName) && externalProxy.Password != null) if (!string.IsNullOrEmpty(externalProxy.UserName) && externalProxy.Password != null)
{ {
connectRequest.Headers.AddHeader(HttpHeader.ProxyConnectionKeepAlive); connectRequest.Headers.AddHeader(HttpHeader.ProxyConnectionKeepAlive);
connectRequest.Headers.AddHeader(HttpHeader.GetProxyAuthorizationHeader(externalProxy.UserName, externalProxy.Password)); connectRequest.Headers.AddHeader(
HttpHeader.GetProxyAuthorizationHeader(externalProxy.UserName, externalProxy.Password));
} }
await writer.WriteRequestAsync(connectRequest, cancellationToken: cancellationToken); await writer.WriteRequestAsync(connectRequest, cancellationToken: cancellationToken);
......
...@@ -13,8 +13,14 @@ namespace Titanium.Web.Proxy ...@@ -13,8 +13,14 @@ namespace Titanium.Web.Proxy
{ {
public partial class ProxyServer public partial class ProxyServer
{ {
/// <summary>
/// Callback to authorize clients of this proxy instance.
/// </summary>
/// <param name="session">The session event arguments.</param>
/// <returns>True if authorized.</returns>
private async Task<bool> CheckAuthorization(SessionEventArgsBase session) private async Task<bool> CheckAuthorization(SessionEventArgsBase session)
{ {
//If we are not authorizing clients return true
if (AuthenticateUserFunc == null) if (AuthenticateUserFunc == null)
{ {
return true; return true;
...@@ -70,6 +76,11 @@ namespace Titanium.Web.Proxy ...@@ -70,6 +76,11 @@ namespace Titanium.Web.Proxy
} }
} }
/// <summary>
/// Create an authentication required response.
/// </summary>
/// <param name="description">Response description.</param>
/// <returns></returns>
private Response CreateAuthentication407Response(string description) private Response CreateAuthentication407Response(string description)
{ {
var response = new Response var response = new Response
......
...@@ -28,6 +28,7 @@ namespace Titanium.Web.Proxy ...@@ -28,6 +28,7 @@ namespace Titanium.Web.Proxy
/// HTTP & HTTPS scheme shorthands. /// HTTP & HTTPS scheme shorthands.
/// </summary> /// </summary>
internal static readonly string UriSchemeHttp = Uri.UriSchemeHttp; internal static readonly string UriSchemeHttp = Uri.UriSchemeHttp;
internal static readonly string UriSchemeHttps = Uri.UriSchemeHttps; internal static readonly string UriSchemeHttps = Uri.UriSchemeHttps;
/// <summary> /// <summary>
...@@ -58,9 +59,15 @@ namespace Titanium.Web.Proxy ...@@ -58,9 +59,15 @@ namespace Titanium.Web.Proxy
/// <summary> /// <summary>
/// Initializes a new instance of ProxyServer class with provided parameters. /// Initializes a new instance of ProxyServer class with provided parameters.
/// </summary> /// </summary>
/// <param name="userTrustRootCertificate">Should fake HTTPS certificate be trusted by this machine's user certificate store?</param> /// <param name="userTrustRootCertificate">
/// Should fake HTTPS certificate be trusted by this machine's user certificate
/// store?
/// </param>
/// <param name="machineTrustRootCertificate">Should fake HTTPS certificate be trusted by this machine's certificate store?</param> /// <param name="machineTrustRootCertificate">Should fake HTTPS certificate be trusted by this machine's certificate store?</param>
/// <param name="trustRootCertificateAsAdmin">Should we attempt to trust certificates with elevated permissions by prompting for UAC if required?</param> /// <param name="trustRootCertificateAsAdmin">
/// Should we attempt to trust certificates with elevated permissions by
/// prompting for UAC if required?
/// </param>
public ProxyServer(bool userTrustRootCertificate = true, bool machineTrustRootCertificate = false, public ProxyServer(bool userTrustRootCertificate = true, bool machineTrustRootCertificate = false,
bool trustRootCertificateAsAdmin = false) : this(null, null, userTrustRootCertificate, bool trustRootCertificateAsAdmin = false) : this(null, null, userTrustRootCertificate,
machineTrustRootCertificate, trustRootCertificateAsAdmin) machineTrustRootCertificate, trustRootCertificateAsAdmin)
...@@ -72,9 +79,15 @@ namespace Titanium.Web.Proxy ...@@ -72,9 +79,15 @@ namespace Titanium.Web.Proxy
/// </summary> /// </summary>
/// <param name="rootCertificateName">Name of the root certificate.</param> /// <param name="rootCertificateName">Name of the root certificate.</param>
/// <param name="rootCertificateIssuerName">Name of the root certificate issuer.</param> /// <param name="rootCertificateIssuerName">Name of the root certificate issuer.</param>
/// <param name="userTrustRootCertificate">Should fake HTTPS certificate be trusted by this machine's user certificate store?</param> /// <param name="userTrustRootCertificate">
/// Should fake HTTPS certificate be trusted by this machine's user certificate
/// store?
/// </param>
/// <param name="machineTrustRootCertificate">Should fake HTTPS certificate be trusted by this machine's certificate store?</param> /// <param name="machineTrustRootCertificate">Should fake HTTPS certificate be trusted by this machine's certificate store?</param>
/// <param name="trustRootCertificateAsAdmin">Should we attempt to trust certificates with elevated permissions by prompting for UAC if required?</param> /// <param name="trustRootCertificateAsAdmin">
/// Should we attempt to trust certificates with elevated permissions by
/// prompting for UAC if required?
/// </param>
public ProxyServer(string rootCertificateName, string rootCertificateIssuerName, public ProxyServer(string rootCertificateName, string rootCertificateIssuerName,
bool userTrustRootCertificate = true, bool machineTrustRootCertificate = false, bool userTrustRootCertificate = true, bool machineTrustRootCertificate = false,
bool trustRootCertificateAsAdmin = false) bool trustRootCertificateAsAdmin = false)
...@@ -667,6 +680,10 @@ namespace Titanium.Web.Proxy ...@@ -667,6 +680,10 @@ namespace Titanium.Web.Proxy
endPoint.Listener.Server.Dispose(); endPoint.Listener.Server.Dispose();
} }
/// <summary>
/// Update client connection count.
/// </summary>
/// <param name="increment"></param>
internal void UpdateClientConnectionCount(bool increment) internal void UpdateClientConnectionCount(bool increment)
{ {
if (increment) if (increment)
...@@ -681,6 +698,10 @@ namespace Titanium.Web.Proxy ...@@ -681,6 +698,10 @@ namespace Titanium.Web.Proxy
ClientConnectionCountChanged?.Invoke(this, EventArgs.Empty); ClientConnectionCountChanged?.Invoke(this, EventArgs.Empty);
} }
/// <summary>
/// Update server connection count.
/// </summary>
/// <param name="increment"></param>
internal void UpdateServerConnectionCount(bool increment) internal void UpdateServerConnectionCount(bool increment)
{ {
if (increment) if (increment)
......
...@@ -27,19 +27,22 @@ namespace Titanium.Web.Proxy ...@@ -27,19 +27,22 @@ namespace Titanium.Web.Proxy
EnableWinAuth && RunTime.IsWindows && !RunTime.IsRunningOnMono; EnableWinAuth && RunTime.IsWindows && !RunTime.IsRunningOnMono;
/// <summary> /// <summary>
/// This is the core request handler method for a particular connection from client /// This is the core request handler method for a particular connection from client.
/// Will create new session (request/response) sequence until /// Will create new session (request/response) sequence until
/// client/server abruptly terminates connection or by normal HTTP termination /// client/server abruptly terminates connection or by normal HTTP termination.
/// </summary> /// </summary>
/// <param name="client"></param> /// <param name="endPoint">The proxy endpoint.</param>
/// <param name="clientStream"></param> /// <param name="client">The client.</param>
/// <param name="clientStreamReader"></param> /// <param name="clientStream">The client stream.</param>
/// <param name="clientStreamWriter"></param> /// <param name="clientStreamReader">The client stream reader.</param>
/// <param name="cancellationTokenSource"></param> /// <param name="clientStreamWriter">The client stream writer.</param>
/// <param name="httpsConnectHostname"></param> /// <param name="cancellationTokenSource">The cancellation token source for this async task.</param>
/// <param name="endPoint"></param> /// <param name="httpsConnectHostname">
/// <param name="connectRequest"></param> /// The https hostname as appeared in CONNECT request if this is a HTTPS request from
/// <param name="isTransparentEndPoint"></param> /// explicit endpoint.
/// </param>
/// <param name="connectRequest">The Connect request if this is a HTTPS request from explicit endpoint.</param>
/// <param name="isTransparentEndPoint">Is this a request from transparent endpoint?</param>
/// <returns></returns> /// <returns></returns>
private async Task HandleHttpSessionRequest(ProxyEndPoint endPoint, TcpClient client, private async Task HandleHttpSessionRequest(ProxyEndPoint endPoint, TcpClient client,
CustomBufferedStream clientStream, CustomBinaryReader clientStreamReader, CustomBufferedStream clientStream, CustomBinaryReader clientStreamReader,
...@@ -272,9 +275,9 @@ namespace Titanium.Web.Proxy ...@@ -272,9 +275,9 @@ namespace Titanium.Web.Proxy
/// <summary> /// <summary>
/// Handle a specific session (request/response sequence) /// Handle a specific session (request/response sequence)
/// </summary> /// </summary>
/// <param name="connection"></param> /// <param name="connection">The tcp connection.</param>
/// <param name="args"></param> /// <param name="args">The session event arguments.</param>
/// <returns>True if close the connection</returns> /// <returns></returns>
private async Task HandleHttpSessionRequestInternal(TcpConnection connection, SessionEventArgs args) private async Task HandleHttpSessionRequestInternal(TcpConnection connection, SessionEventArgs args)
{ {
try try
...@@ -290,7 +293,8 @@ namespace Titanium.Web.Proxy ...@@ -290,7 +293,8 @@ namespace Titanium.Web.Proxy
if (request.ExpectContinue) if (request.ExpectContinue)
{ {
args.WebSession.SetConnection(connection); args.WebSession.SetConnection(connection);
await args.WebSession.SendRequest(Enable100ContinueBehaviour, args.IsTransparent, cancellationToken); await args.WebSession.SendRequest(Enable100ContinueBehaviour, args.IsTransparent,
cancellationToken);
} }
//If 100 continue was the response inform that to the client //If 100 continue was the response inform that to the client
...@@ -316,7 +320,8 @@ namespace Titanium.Web.Proxy ...@@ -316,7 +320,8 @@ namespace Titanium.Web.Proxy
if (!request.ExpectContinue) if (!request.ExpectContinue)
{ {
args.WebSession.SetConnection(connection); args.WebSession.SetConnection(connection);
await args.WebSession.SendRequest(Enable100ContinueBehaviour, args.IsTransparent, cancellationToken); await args.WebSession.SendRequest(Enable100ContinueBehaviour, args.IsTransparent,
cancellationToken);
} }
//check if content-length is > 0 //check if content-length is > 0
...@@ -353,13 +358,14 @@ namespace Titanium.Web.Proxy ...@@ -353,13 +358,14 @@ namespace Titanium.Web.Proxy
} }
/// <summary> /// <summary>
/// Create a Server Connection /// Create a server connection.
/// </summary> /// </summary>
/// <param name="args"></param> /// <param name="args">The session event arguments.</param>
/// <param name="isConnect"></param> /// <param name="isConnect">Is this a CONNECT request.</param>
/// <param name="cancellationToken"></param> /// <param name="cancellationToken">The cancellation token for this async task.</param>
/// <returns></returns> /// <returns></returns>
private async Task<TcpConnection> GetServerConnection(SessionEventArgsBase args, bool isConnect, CancellationToken cancellationToken) private async Task<TcpConnection> GetServerConnection(SessionEventArgsBase args, bool isConnect,
CancellationToken cancellationToken)
{ {
ExternalProxy customUpStreamProxy = null; ExternalProxy customUpStreamProxy = null;
...@@ -382,7 +388,7 @@ namespace Titanium.Web.Proxy ...@@ -382,7 +388,7 @@ namespace Titanium.Web.Proxy
} }
/// <summary> /// <summary>
/// prepare the request headers so that we can avoid encodings not parsable by this proxy /// Prepare the request headers so that we can avoid encodings not parsable by this proxy
/// </summary> /// </summary>
/// <param name="requestHeaders"></param> /// <param name="requestHeaders"></param>
private void PrepareRequestHeaders(HeaderCollection requestHeaders) private void PrepareRequestHeaders(HeaderCollection requestHeaders)
...@@ -395,6 +401,11 @@ namespace Titanium.Web.Proxy ...@@ -395,6 +401,11 @@ namespace Titanium.Web.Proxy
requestHeaders.FixProxyHeaders(); requestHeaders.FixProxyHeaders();
} }
/// <summary>
/// Invoke before request handler if it is set.
/// </summary>
/// <param name="args">The session event arguments.</param>
/// <returns></returns>
private async Task InvokeBeforeRequest(SessionEventArgs args) private async Task InvokeBeforeRequest(SessionEventArgs args)
{ {
if (BeforeRequest != null) if (BeforeRequest != null)
......
...@@ -9,15 +9,15 @@ using Titanium.Web.Proxy.Network.WinAuth.Security; ...@@ -9,15 +9,15 @@ using Titanium.Web.Proxy.Network.WinAuth.Security;
namespace Titanium.Web.Proxy namespace Titanium.Web.Proxy
{ {
/// <summary> /// <summary>
/// Handle the response from server /// Handle the response from server.
/// </summary> /// </summary>
partial class ProxyServer partial class ProxyServer
{ {
/// <summary> /// <summary>
/// Called asynchronously when a request was successfully and we received the response /// Called asynchronously when a request was successfully and we received the response.
/// </summary> /// </summary>
/// <param name="args"></param> /// <param name="args">The session event arguments.</param>
/// <returns>true if client/server connection was terminated (and disposed) </returns> /// <returns> The task.</returns>
private async Task HandleHttpSessionResponse(SessionEventArgs args) private async Task HandleHttpSessionResponse(SessionEventArgs args)
{ {
try try
...@@ -118,7 +118,8 @@ namespace Titanium.Web.Proxy ...@@ -118,7 +118,8 @@ namespace Titanium.Web.Proxy
//Write body if exists //Write body if exists
if (response.HasBody) if (response.HasBody)
{ {
await args.CopyResponseBodyAsync(clientStreamWriter, TransformationMode.None, cancellationToken); await args.CopyResponseBodyAsync(clientStreamWriter, TransformationMode.None,
cancellationToken);
} }
} }
} }
...@@ -128,6 +129,11 @@ namespace Titanium.Web.Proxy ...@@ -128,6 +129,11 @@ namespace Titanium.Web.Proxy
} }
} }
/// <summary>
/// Invoke before response if it is set.
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
private async Task InvokeBeforeResponse(SessionEventArgs args) private async Task InvokeBeforeResponse(SessionEventArgs args)
{ {
if (BeforeResponse != null) if (BeforeResponse != null)
...@@ -136,6 +142,11 @@ namespace Titanium.Web.Proxy ...@@ -136,6 +142,11 @@ namespace Titanium.Web.Proxy
} }
} }
/// <summary>
/// Invoke after response if it is set.
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
private async Task InvokeAfterResponse(SessionEventArgs args) private async Task InvokeAfterResponse(SessionEventArgs args)
{ {
if (AfterResponse != null) if (AfterResponse != null)
......
...@@ -17,11 +17,11 @@ namespace Titanium.Web.Proxy ...@@ -17,11 +17,11 @@ namespace Titanium.Web.Proxy
partial class ProxyServer partial class ProxyServer
{ {
/// <summary> /// <summary>
/// This is called when this proxy acts as a reverse proxy (like a real http server) /// This is called when this proxy acts as a reverse proxy (like a real http server).
/// So for HTTPS requests we would start SSL negotiation right away without expecting a CONNECT request from client /// So for HTTPS requests we would start SSL negotiation right away without expecting a CONNECT request from client
/// </summary> /// </summary>
/// <param name="endPoint"></param> /// <param name="endPoint">The transparent endpoint.</param>
/// <param name="tcpClient"></param> /// <param name="tcpClient">The client.</param>
/// <returns></returns> /// <returns></returns>
private async Task HandleClient(TransparentProxyEndPoint endPoint, TcpClient tcpClient) private async Task HandleClient(TransparentProxyEndPoint endPoint, TcpClient tcpClient)
{ {
...@@ -44,8 +44,11 @@ namespace Titanium.Web.Proxy ...@@ -44,8 +44,11 @@ namespace Titanium.Web.Proxy
{ {
httpsHostName = clientHelloInfo.GetServerName() ?? endPoint.GenericCertificateName; httpsHostName = clientHelloInfo.GetServerName() ?? endPoint.GenericCertificateName;
var args = new BeforeSslAuthenticateEventArgs(cancellationTokenSource); var args = new BeforeSslAuthenticateEventArgs(cancellationTokenSource)
args.SniHostName = httpsHostName; {
SniHostName = httpsHostName
};
await endPoint.InvokeBeforeSslAuthenticate(this, args, ExceptionFunc); await endPoint.InvokeBeforeSslAuthenticate(this, args, ExceptionFunc);
if (cancellationTokenSource.IsCancellationRequested) if (cancellationTokenSource.IsCancellationRequested)
......
...@@ -13,7 +13,9 @@ namespace Titanium.Web.Proxy ...@@ -13,7 +13,9 @@ namespace Titanium.Web.Proxy
{ {
public partial class ProxyServer public partial class ProxyServer
{ {
//possible header names /// <summary>
/// possible header names.
/// </summary>
private static readonly HashSet<string> authHeaderNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase) private static readonly HashSet<string> authHeaderNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{ {
"WWW-Authenticate", "WWW-Authenticate",
...@@ -24,6 +26,9 @@ namespace Titanium.Web.Proxy ...@@ -24,6 +26,9 @@ namespace Titanium.Web.Proxy
"KerberosAuthorization" "KerberosAuthorization"
}; };
/// <summary>
/// supported authentication schemes.
/// </summary>
private static readonly HashSet<string> authSchemes = new HashSet<string>(StringComparer.OrdinalIgnoreCase) private static readonly HashSet<string> authSchemes = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{ {
"NTLM", "NTLM",
...@@ -32,13 +37,12 @@ namespace Titanium.Web.Proxy ...@@ -32,13 +37,12 @@ namespace Titanium.Web.Proxy
}; };
/// <summary> /// <summary>
/// Handle windows NTLM authentication /// Handle windows NTLM/Kerberos authentication.
/// Can expand this for Kerberos in future
/// Note: NTLM/Kerberos cannot do a man in middle operation /// Note: NTLM/Kerberos cannot do a man in middle operation
/// we do for HTTPS requests. /// we do for HTTPS requests.
/// As such we will be sending local credentials of current /// As such we will be sending local credentials of current
/// User to server to authenticate requests. /// User to server to authenticate requests.
/// To disable this set ProxyServer.EnableWinAuth to false /// To disable this set ProxyServer.EnableWinAuth to false.
/// </summary> /// </summary>
internal async Task Handle401UnAuthorized(SessionEventArgs args) internal async Task Handle401UnAuthorized(SessionEventArgs args)
{ {
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
<h1 id="Titanium_Web_Proxy_EventArguments_BeforeSslAuthenticateEventArgs" data-uid="Titanium.Web.Proxy.EventArguments.BeforeSslAuthenticateEventArgs" class="text-break">Class BeforeSslAuthenticateEventArgs <h1 id="Titanium_Web_Proxy_EventArguments_BeforeSslAuthenticateEventArgs" data-uid="Titanium.Web.Proxy.EventArguments.BeforeSslAuthenticateEventArgs" class="text-break">Class BeforeSslAuthenticateEventArgs
</h1> </h1>
<div class="markdown level0 summary"><p>This is used in transparent endpoint before authenticating client. </p> <div class="markdown level0 summary"><p>This is used in transparent endpoint before authenticating client.</p>
</div> </div>
<div class="markdown level0 conceptual"></div> <div class="markdown level0 conceptual"></div>
<div class="inheritance"> <div class="inheritance">
...@@ -159,7 +159,8 @@ If false we relay the connection to the hostname mentioned in SniHostname.</p> ...@@ -159,7 +159,8 @@ If false we relay the connection to the hostname mentioned in SniHostname.</p>
<a id="Titanium_Web_Proxy_EventArguments_BeforeSslAuthenticateEventArgs_SniHostName_" data-uid="Titanium.Web.Proxy.EventArguments.BeforeSslAuthenticateEventArgs.SniHostName*"></a> <a id="Titanium_Web_Proxy_EventArguments_BeforeSslAuthenticateEventArgs_SniHostName_" data-uid="Titanium.Web.Proxy.EventArguments.BeforeSslAuthenticateEventArgs.SniHostName*"></a>
<h4 id="Titanium_Web_Proxy_EventArguments_BeforeSslAuthenticateEventArgs_SniHostName" data-uid="Titanium.Web.Proxy.EventArguments.BeforeSslAuthenticateEventArgs.SniHostName">SniHostName</h4> <h4 id="Titanium_Web_Proxy_EventArguments_BeforeSslAuthenticateEventArgs_SniHostName" data-uid="Titanium.Web.Proxy.EventArguments.BeforeSslAuthenticateEventArgs.SniHostName">SniHostName</h4>
<div class="markdown level1 summary"><p>The server name indication hostname if available. Otherwise the generic certificate hostname of TransparentEndPoint.</p> <div class="markdown level1 summary"><p>The server name indication hostname if available. Otherwise the generic certificate hostname of
TransparentEndPoint.</p>
</div> </div>
<div class="markdown level1 conceptual"></div> <div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5> <h5 class="decalaration">Declaration</h5>
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
<h3 id="classes">Classes <h3 id="classes">Classes
</h3> </h3>
<h4><a class="xref" href="Titanium.Web.Proxy.EventArguments.BeforeSslAuthenticateEventArgs.html">BeforeSslAuthenticateEventArgs</a></h4> <h4><a class="xref" href="Titanium.Web.Proxy.EventArguments.BeforeSslAuthenticateEventArgs.html">BeforeSslAuthenticateEventArgs</a></h4>
<section><p>This is used in transparent endpoint before authenticating client. </p> <section><p>This is used in transparent endpoint before authenticating client.</p>
</section> </section>
<h4><a class="xref" href="Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.html">CertificateSelectionEventArgs</a></h4> <h4><a class="xref" href="Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.html">CertificateSelectionEventArgs</a></h4>
<section><p>An argument passed on to user for client certificate selection during mutual SSL authentication.</p> <section><p>An argument passed on to user for client certificate selection during mutual SSL authentication.</p>
......
...@@ -508,7 +508,8 @@ Note:setting machineTrustRootCertificate to true will force userTrustRootCertifi ...@@ -508,7 +508,8 @@ Note:setting machineTrustRootCertificate to true will force userTrustRootCertifi
<tr> <tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td> <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
<td><span class="parametername">userTrustRootCertificate</span></td> <td><span class="parametername">userTrustRootCertificate</span></td>
<td><p>Should fake HTTPS certificate be trusted by this machine&apos;s user certificate store?</p> <td><p>Should fake HTTPS certificate be trusted by this machine&apos;s user certificate
store?</p>
</td> </td>
</tr> </tr>
<tr> <tr>
...@@ -520,7 +521,8 @@ Note:setting machineTrustRootCertificate to true will force userTrustRootCertifi ...@@ -520,7 +521,8 @@ Note:setting machineTrustRootCertificate to true will force userTrustRootCertifi
<tr> <tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td> <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
<td><span class="parametername">trustRootCertificateAsAdmin</span></td> <td><span class="parametername">trustRootCertificateAsAdmin</span></td>
<td><p>Should we attempt to trust certificates with elevated permissions by prompting for UAC if required?</p> <td><p>Should we attempt to trust certificates with elevated permissions by
prompting for UAC if required?</p>
</td> </td>
</tr> </tr>
</tbody> </tbody>
...@@ -640,7 +642,8 @@ named as &quot;rootCert.pfx&quot; (and will be saved in proxy dll directory).</p ...@@ -640,7 +642,8 @@ named as &quot;rootCert.pfx&quot; (and will be saved in proxy dll directory).</p
<tr> <tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td> <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
<td><span class="parametername">overwritePfXFile</span></td> <td><span class="parametername">overwritePfXFile</span></td>
<td><p>true : replace an existing .pfx file if password is incorect or if RootCertificate==null.</p> <td><p>true : replace an existing .pfx file if password is incorect or if
RootCertificate==null.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
<h1 id="Titanium_Web_Proxy_ProxyServer" data-uid="Titanium.Web.Proxy.ProxyServer" class="text-break">Class ProxyServer <h1 id="Titanium_Web_Proxy_ProxyServer" data-uid="Titanium.Web.Proxy.ProxyServer" class="text-break">Class ProxyServer
</h1> </h1>
<div class="markdown level0 summary"><p>This object is the backbone of proxy. One can create as many instances as needed. <div class="markdown level0 summary"><p>This object is the backbone of proxy. One can create as many instances as needed.
However care should be taken to avoid using the same listening ports across multiple instances. </p> However care should be taken to avoid using the same listening ports across multiple instances.</p>
</div> </div>
<div class="markdown level0 conceptual"></div> <div class="markdown level0 conceptual"></div>
<div class="inheritance"> <div class="inheritance">
...@@ -152,7 +152,8 @@ However care should be taken to avoid using the same listening ports across mult ...@@ -152,7 +152,8 @@ However care should be taken to avoid using the same listening ports across mult
<tr> <tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td> <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
<td><span class="parametername">userTrustRootCertificate</span></td> <td><span class="parametername">userTrustRootCertificate</span></td>
<td><p>Should fake HTTPS certificate be trusted by this machine&apos;s user certificate store?</p> <td><p>Should fake HTTPS certificate be trusted by this machine&apos;s user certificate
store?</p>
</td> </td>
</tr> </tr>
<tr> <tr>
...@@ -164,7 +165,8 @@ However care should be taken to avoid using the same listening ports across mult ...@@ -164,7 +165,8 @@ However care should be taken to avoid using the same listening ports across mult
<tr> <tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td> <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
<td><span class="parametername">trustRootCertificateAsAdmin</span></td> <td><span class="parametername">trustRootCertificateAsAdmin</span></td>
<td><p>Should we attempt to trust certificates with elevated permissions by prompting for UAC if required?</p> <td><p>Should we attempt to trust certificates with elevated permissions by
prompting for UAC if required?</p>
</td> </td>
</tr> </tr>
</tbody> </tbody>
...@@ -205,7 +207,8 @@ However care should be taken to avoid using the same listening ports across mult ...@@ -205,7 +207,8 @@ However care should be taken to avoid using the same listening ports across mult
<tr> <tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td> <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
<td><span class="parametername">userTrustRootCertificate</span></td> <td><span class="parametername">userTrustRootCertificate</span></td>
<td><p>Should fake HTTPS certificate be trusted by this machine&apos;s user certificate store?</p> <td><p>Should fake HTTPS certificate be trusted by this machine&apos;s user certificate
store?</p>
</td> </td>
</tr> </tr>
<tr> <tr>
...@@ -217,7 +220,8 @@ However care should be taken to avoid using the same listening ports across mult ...@@ -217,7 +220,8 @@ However care should be taken to avoid using the same listening ports across mult
<tr> <tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td> <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
<td><span class="parametername">trustRootCertificateAsAdmin</span></td> <td><span class="parametername">trustRootCertificateAsAdmin</span></td>
<td><p>Should we attempt to trust certificates with elevated permissions by prompting for UAC if required?</p> <td><p>Should we attempt to trust certificates with elevated permissions by
prompting for UAC if required?</p>
</td> </td>
</tr> </tr>
</tbody> </tbody>
...@@ -794,7 +798,7 @@ Defaults via any IP addresses of this machine.</p> ...@@ -794,7 +798,7 @@ Defaults via any IP addresses of this machine.</p>
<a id="Titanium_Web_Proxy_ProxyServer_DisableSystemProxy_" data-uid="Titanium.Web.Proxy.ProxyServer.DisableSystemProxy*"></a> <a id="Titanium_Web_Proxy_ProxyServer_DisableSystemProxy_" data-uid="Titanium.Web.Proxy.ProxyServer.DisableSystemProxy*"></a>
<h4 id="Titanium_Web_Proxy_ProxyServer_DisableSystemProxy_Titanium_Web_Proxy_Helpers_ProxyProtocolType_" data-uid="Titanium.Web.Proxy.ProxyServer.DisableSystemProxy(Titanium.Web.Proxy.Helpers.ProxyProtocolType)">DisableSystemProxy(ProxyProtocolType)</h4> <h4 id="Titanium_Web_Proxy_ProxyServer_DisableSystemProxy_ProxyProtocolType_" data-uid="Titanium.Web.Proxy.ProxyServer.DisableSystemProxy(ProxyProtocolType)">DisableSystemProxy(ProxyProtocolType)</h4>
<div class="markdown level1 summary"><p>Clear the specified proxy setting for current machine.</p> <div class="markdown level1 summary"><p>Clear the specified proxy setting for current machine.</p>
</div> </div>
<div class="markdown level1 conceptual"></div> <div class="markdown level1 conceptual"></div>
...@@ -813,7 +817,7 @@ Defaults via any IP addresses of this machine.</p> ...@@ -813,7 +817,7 @@ Defaults via any IP addresses of this machine.</p>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td><a class="xref" href="Titanium.Web.Proxy.Helpers.ProxyProtocolType.html">ProxyProtocolType</a></td> <td><span class="xref">ProxyProtocolType</span></td>
<td><span class="parametername">protocolType</span></td> <td><span class="parametername">protocolType</span></td>
<td></td> <td></td>
</tr> </tr>
...@@ -919,7 +923,7 @@ Will throw error if the end point does&apos;nt exist</p> ...@@ -919,7 +923,7 @@ Will throw error if the end point does&apos;nt exist</p>
<a id="Titanium_Web_Proxy_ProxyServer_SetAsSystemProxy_" data-uid="Titanium.Web.Proxy.ProxyServer.SetAsSystemProxy*"></a> <a id="Titanium_Web_Proxy_ProxyServer_SetAsSystemProxy_" data-uid="Titanium.Web.Proxy.ProxyServer.SetAsSystemProxy*"></a>
<h4 id="Titanium_Web_Proxy_ProxyServer_SetAsSystemProxy_Titanium_Web_Proxy_Models_ExplicitProxyEndPoint_Titanium_Web_Proxy_Helpers_ProxyProtocolType_" data-uid="Titanium.Web.Proxy.ProxyServer.SetAsSystemProxy(Titanium.Web.Proxy.Models.ExplicitProxyEndPoint,Titanium.Web.Proxy.Helpers.ProxyProtocolType)">SetAsSystemProxy(ExplicitProxyEndPoint, ProxyProtocolType)</h4> <h4 id="Titanium_Web_Proxy_ProxyServer_SetAsSystemProxy_Titanium_Web_Proxy_Models_ExplicitProxyEndPoint_ProxyProtocolType_" data-uid="Titanium.Web.Proxy.ProxyServer.SetAsSystemProxy(Titanium.Web.Proxy.Models.ExplicitProxyEndPoint,ProxyProtocolType)">SetAsSystemProxy(ExplicitProxyEndPoint, ProxyProtocolType)</h4>
<div class="markdown level1 summary"><p>Set the given explicit end point as the default proxy server for current machine.</p> <div class="markdown level1 summary"><p>Set the given explicit end point as the default proxy server for current machine.</p>
</div> </div>
<div class="markdown level1 conceptual"></div> <div class="markdown level1 conceptual"></div>
...@@ -943,7 +947,7 @@ Will throw error if the end point does&apos;nt exist</p> ...@@ -943,7 +947,7 @@ Will throw error if the end point does&apos;nt exist</p>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td><a class="xref" href="Titanium.Web.Proxy.Helpers.ProxyProtocolType.html">ProxyProtocolType</a></td> <td><span class="xref">ProxyProtocolType</span></td>
<td><span class="parametername">protocolType</span></td> <td><span class="parametername">protocolType</span></td>
<td></td> <td></td>
</tr> </tr>
......
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
</h3> </h3>
<h4><a class="xref" href="Titanium.Web.Proxy.ProxyServer.html">ProxyServer</a></h4> <h4><a class="xref" href="Titanium.Web.Proxy.ProxyServer.html">ProxyServer</a></h4>
<section><p>This object is the backbone of proxy. One can create as many instances as needed. <section><p>This object is the backbone of proxy. One can create as many instances as needed.
However care should be taken to avoid using the same listening ports across multiple instances. </p> However care should be taken to avoid using the same listening ports across multiple instances.</p>
</section> </section>
<h3 id="delegates">Delegates <h3 id="delegates">Delegates
</h3> </h3>
......
...@@ -74,15 +74,6 @@ ...@@ -74,15 +74,6 @@
<a href="Titanium.Web.Proxy.Exceptions.ProxyHttpException.html" name="" title="ProxyHttpException">ProxyHttpException</a> <a href="Titanium.Web.Proxy.Exceptions.ProxyHttpException.html" name="" title="ProxyHttpException">ProxyHttpException</a>
</li> </li>
</ul> </li> </ul> </li>
<li>
<span class="expand-stub"></span>
<a href="Titanium.Web.Proxy.Helpers.html" name="" title="Titanium.Web.Proxy.Helpers">Titanium.Web.Proxy.Helpers</a>
<ul class="nav level2">
<li>
<a href="Titanium.Web.Proxy.Helpers.ProxyProtocolType.html" name="" title="ProxyProtocolType">ProxyProtocolType</a>
</li>
</ul> </li>
<li> <li>
<span class="expand-stub"></span> <span class="expand-stub"></span>
<a href="Titanium.Web.Proxy.Http.html" name="" title="Titanium.Web.Proxy.Http">Titanium.Web.Proxy.Http</a> <a href="Titanium.Web.Proxy.Http.html" name="" title="Titanium.Web.Proxy.Http">Titanium.Web.Proxy.Http</a>
......
...@@ -79,16 +79,6 @@ ...@@ -79,16 +79,6 @@
"title": "Class ProxyHttpException | Titanium Web Proxy", "title": "Class ProxyHttpException | Titanium Web Proxy",
"keywords": "Class ProxyHttpException Proxy HTTP exception. Inheritance Object Exception ProxyException ProxyHttpException Implements ISerializable _Exception Inherited Members Exception.GetBaseException() Exception.ToString() Exception.GetObjectData(SerializationInfo, StreamingContext) Exception.GetType() Exception.Message Exception.Data Exception.InnerException Exception.TargetSite Exception.StackTrace Exception.HelpLink Exception.Source Exception.HResult Exception.SerializeObjectState Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Exceptions Assembly : Titanium.Web.Proxy.dll Syntax public class ProxyHttpException : ProxyException, ISerializable, _Exception Properties SessionEventArgs Gets session info associated to the exception. Declaration public SessionEventArgs SessionEventArgs { get; } Property Value Type Description SessionEventArgs Remarks This object properties should not be edited. Implements System.Runtime.Serialization.ISerializable System.Runtime.InteropServices._Exception" "keywords": "Class ProxyHttpException Proxy HTTP exception. Inheritance Object Exception ProxyException ProxyHttpException Implements ISerializable _Exception Inherited Members Exception.GetBaseException() Exception.ToString() Exception.GetObjectData(SerializationInfo, StreamingContext) Exception.GetType() Exception.Message Exception.Data Exception.InnerException Exception.TargetSite Exception.StackTrace Exception.HelpLink Exception.Source Exception.HResult Exception.SerializeObjectState Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Exceptions Assembly : Titanium.Web.Proxy.dll Syntax public class ProxyHttpException : ProxyException, ISerializable, _Exception Properties SessionEventArgs Gets session info associated to the exception. Declaration public SessionEventArgs SessionEventArgs { get; } Property Value Type Description SessionEventArgs Remarks This object properties should not be edited. Implements System.Runtime.Serialization.ISerializable System.Runtime.InteropServices._Exception"
}, },
"api/Titanium.Web.Proxy.Helpers.html": {
"href": "api/Titanium.Web.Proxy.Helpers.html",
"title": "Namespace Titanium.Web.Proxy.Helpers | Titanium Web Proxy",
"keywords": "Namespace Titanium.Web.Proxy.Helpers Enums ProxyProtocolType"
},
"api/Titanium.Web.Proxy.Helpers.ProxyProtocolType.html": {
"href": "api/Titanium.Web.Proxy.Helpers.ProxyProtocolType.html",
"title": "Enum ProxyProtocolType | Titanium Web Proxy",
"keywords": "Enum ProxyProtocolType Namespace : Titanium.Web.Proxy.Helpers Assembly : Titanium.Web.Proxy.dll Syntax [Flags] public enum ProxyProtocolType Fields Name Description AllHttp Both HTTP and HTTPS Http HTTP Https HTTPS None The none"
},
"api/Titanium.Web.Proxy.html": { "api/Titanium.Web.Proxy.html": {
"href": "api/Titanium.Web.Proxy.html", "href": "api/Titanium.Web.Proxy.html",
"title": "Namespace Titanium.Web.Proxy | Titanium Web Proxy", "title": "Namespace Titanium.Web.Proxy | Titanium Web Proxy",
......
...@@ -848,42 +848,6 @@ references: ...@@ -848,42 +848,6 @@ references:
isSpec: "True" isSpec: "True"
fullName: Titanium.Web.Proxy.Exceptions.ProxyHttpException.SessionEventArgs fullName: Titanium.Web.Proxy.Exceptions.ProxyHttpException.SessionEventArgs
nameWithType: ProxyHttpException.SessionEventArgs nameWithType: ProxyHttpException.SessionEventArgs
- uid: Titanium.Web.Proxy.Helpers
name: Titanium.Web.Proxy.Helpers
href: api/Titanium.Web.Proxy.Helpers.html
commentId: N:Titanium.Web.Proxy.Helpers
fullName: Titanium.Web.Proxy.Helpers
nameWithType: Titanium.Web.Proxy.Helpers
- uid: Titanium.Web.Proxy.Helpers.ProxyProtocolType
name: ProxyProtocolType
href: api/Titanium.Web.Proxy.Helpers.ProxyProtocolType.html
commentId: T:Titanium.Web.Proxy.Helpers.ProxyProtocolType
fullName: Titanium.Web.Proxy.Helpers.ProxyProtocolType
nameWithType: ProxyProtocolType
- uid: Titanium.Web.Proxy.Helpers.ProxyProtocolType.AllHttp
name: AllHttp
href: api/Titanium.Web.Proxy.Helpers.ProxyProtocolType.html#Titanium_Web_Proxy_Helpers_ProxyProtocolType_AllHttp
commentId: F:Titanium.Web.Proxy.Helpers.ProxyProtocolType.AllHttp
fullName: Titanium.Web.Proxy.Helpers.ProxyProtocolType.AllHttp
nameWithType: ProxyProtocolType.AllHttp
- uid: Titanium.Web.Proxy.Helpers.ProxyProtocolType.Http
name: Http
href: api/Titanium.Web.Proxy.Helpers.ProxyProtocolType.html#Titanium_Web_Proxy_Helpers_ProxyProtocolType_Http
commentId: F:Titanium.Web.Proxy.Helpers.ProxyProtocolType.Http
fullName: Titanium.Web.Proxy.Helpers.ProxyProtocolType.Http
nameWithType: ProxyProtocolType.Http
- uid: Titanium.Web.Proxy.Helpers.ProxyProtocolType.Https
name: Https
href: api/Titanium.Web.Proxy.Helpers.ProxyProtocolType.html#Titanium_Web_Proxy_Helpers_ProxyProtocolType_Https
commentId: F:Titanium.Web.Proxy.Helpers.ProxyProtocolType.Https
fullName: Titanium.Web.Proxy.Helpers.ProxyProtocolType.Https
nameWithType: ProxyProtocolType.Https
- uid: Titanium.Web.Proxy.Helpers.ProxyProtocolType.None
name: None
href: api/Titanium.Web.Proxy.Helpers.ProxyProtocolType.html#Titanium_Web_Proxy_Helpers_ProxyProtocolType_None
commentId: F:Titanium.Web.Proxy.Helpers.ProxyProtocolType.None
fullName: Titanium.Web.Proxy.Helpers.ProxyProtocolType.None
nameWithType: ProxyProtocolType.None
- uid: Titanium.Web.Proxy.Http - uid: Titanium.Web.Proxy.Http
name: Titanium.Web.Proxy.Http name: Titanium.Web.Proxy.Http
href: api/Titanium.Web.Proxy.Http.html href: api/Titanium.Web.Proxy.Http.html
...@@ -2786,11 +2750,11 @@ references: ...@@ -2786,11 +2750,11 @@ references:
isSpec: "True" isSpec: "True"
fullName: Titanium.Web.Proxy.ProxyServer.DisableSystemHttpsProxy fullName: Titanium.Web.Proxy.ProxyServer.DisableSystemHttpsProxy
nameWithType: ProxyServer.DisableSystemHttpsProxy nameWithType: ProxyServer.DisableSystemHttpsProxy
- uid: Titanium.Web.Proxy.ProxyServer.DisableSystemProxy(Titanium.Web.Proxy.Helpers.ProxyProtocolType) - uid: Titanium.Web.Proxy.ProxyServer.DisableSystemProxy(ProxyProtocolType)
name: DisableSystemProxy(ProxyProtocolType) name: DisableSystemProxy(ProxyProtocolType)
href: api/Titanium.Web.Proxy.ProxyServer.html#Titanium_Web_Proxy_ProxyServer_DisableSystemProxy_Titanium_Web_Proxy_Helpers_ProxyProtocolType_ href: api/Titanium.Web.Proxy.ProxyServer.html#Titanium_Web_Proxy_ProxyServer_DisableSystemProxy_ProxyProtocolType_
commentId: M:Titanium.Web.Proxy.ProxyServer.DisableSystemProxy(Titanium.Web.Proxy.Helpers.ProxyProtocolType) commentId: M:Titanium.Web.Proxy.ProxyServer.DisableSystemProxy(ProxyProtocolType)
fullName: Titanium.Web.Proxy.ProxyServer.DisableSystemProxy(Titanium.Web.Proxy.Helpers.ProxyProtocolType) fullName: Titanium.Web.Proxy.ProxyServer.DisableSystemProxy(ProxyProtocolType)
nameWithType: ProxyServer.DisableSystemProxy(ProxyProtocolType) nameWithType: ProxyServer.DisableSystemProxy(ProxyProtocolType)
- uid: Titanium.Web.Proxy.ProxyServer.DisableSystemProxy* - uid: Titanium.Web.Proxy.ProxyServer.DisableSystemProxy*
name: DisableSystemProxy name: DisableSystemProxy
...@@ -2980,11 +2944,11 @@ references: ...@@ -2980,11 +2944,11 @@ references:
isSpec: "True" isSpec: "True"
fullName: Titanium.Web.Proxy.ProxyServer.SetAsSystemHttpsProxy fullName: Titanium.Web.Proxy.ProxyServer.SetAsSystemHttpsProxy
nameWithType: ProxyServer.SetAsSystemHttpsProxy nameWithType: ProxyServer.SetAsSystemHttpsProxy
- uid: Titanium.Web.Proxy.ProxyServer.SetAsSystemProxy(Titanium.Web.Proxy.Models.ExplicitProxyEndPoint,Titanium.Web.Proxy.Helpers.ProxyProtocolType) - uid: Titanium.Web.Proxy.ProxyServer.SetAsSystemProxy(Titanium.Web.Proxy.Models.ExplicitProxyEndPoint,ProxyProtocolType)
name: SetAsSystemProxy(ExplicitProxyEndPoint, ProxyProtocolType) name: SetAsSystemProxy(ExplicitProxyEndPoint, ProxyProtocolType)
href: api/Titanium.Web.Proxy.ProxyServer.html#Titanium_Web_Proxy_ProxyServer_SetAsSystemProxy_Titanium_Web_Proxy_Models_ExplicitProxyEndPoint_Titanium_Web_Proxy_Helpers_ProxyProtocolType_ href: api/Titanium.Web.Proxy.ProxyServer.html#Titanium_Web_Proxy_ProxyServer_SetAsSystemProxy_Titanium_Web_Proxy_Models_ExplicitProxyEndPoint_ProxyProtocolType_
commentId: M:Titanium.Web.Proxy.ProxyServer.SetAsSystemProxy(Titanium.Web.Proxy.Models.ExplicitProxyEndPoint,Titanium.Web.Proxy.Helpers.ProxyProtocolType) commentId: M:Titanium.Web.Proxy.ProxyServer.SetAsSystemProxy(Titanium.Web.Proxy.Models.ExplicitProxyEndPoint,ProxyProtocolType)
fullName: Titanium.Web.Proxy.ProxyServer.SetAsSystemProxy(Titanium.Web.Proxy.Models.ExplicitProxyEndPoint, Titanium.Web.Proxy.Helpers.ProxyProtocolType) fullName: Titanium.Web.Proxy.ProxyServer.SetAsSystemProxy(Titanium.Web.Proxy.Models.ExplicitProxyEndPoint, ProxyProtocolType)
nameWithType: ProxyServer.SetAsSystemProxy(ExplicitProxyEndPoint, ProxyProtocolType) nameWithType: ProxyServer.SetAsSystemProxy(ExplicitProxyEndPoint, ProxyProtocolType)
- uid: Titanium.Web.Proxy.ProxyServer.SetAsSystemProxy* - uid: Titanium.Web.Proxy.ProxyServer.SetAsSystemProxy*
name: SetAsSystemProxy name: SetAsSystemProxy
......
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