Commit a740f847 authored by justcoding121's avatar justcoding121

Update documentation

parent aa04b0f9
......@@ -2,5 +2,12 @@
namespace Titanium.Web.Proxy.EventArguments
{
/// <summary>
/// A generic asynchronous event handler used by this proxy.
/// </summary>
/// <typeparam name="TEventArgs"></typeparam>
/// <param name="sender">The proxy server instance.</param>
/// <param name="e">The event arguments.</param>
/// <returns></returns>
public delegate Task AsyncEventHandler<in TEventArgs>(object sender, TEventArgs e);
}
......@@ -3,6 +3,9 @@ using System.Threading;
namespace Titanium.Web.Proxy.EventArguments
{
/// <summary>
/// This is used in transparent endpoint before authenticating client.
/// </summary>
public class BeforeSslAuthenticateEventArgs : EventArgs
{
internal readonly CancellationTokenSource TaskCancellationSource;
......@@ -12,10 +15,21 @@ namespace Titanium.Web.Proxy.EventArguments
TaskCancellationSource = taskCancellationSource;
}
/// <summary>
/// The server name indication hostname.
/// </summary>
public string SniHostName { get; internal set; }
/// <summary>
/// Should we decrypt the SSL request?
/// If true we decrypt with fake certificate.
/// If false we relay the connection to the hostname mentioned in SniHostname.
/// </summary>
public bool DecryptSsl { get; set; } = true;
/// <summary>
/// Terminate the request abruptly.
/// </summary>
public void TerminateSession()
{
TaskCancellationSource.Cancel();
......
......@@ -4,37 +4,37 @@ using System.Security.Cryptography.X509Certificates;
namespace Titanium.Web.Proxy.EventArguments
{
/// <summary>
/// An argument passed on to user for client certificate selection during mutual SSL authentication
/// An argument passed on to user for client certificate selection during mutual SSL authentication.
/// </summary>
public class CertificateSelectionEventArgs : EventArgs
{
/// <summary>
/// Sender object.
/// The proxy server instance.
/// </summary>
public object Sender { get; internal set; }
/// <summary>
/// Target host.
/// The host to which we are authenticating against.
/// </summary>
public string TargetHost { get; internal set; }
/// <summary>
/// Local certificates.
/// Local certificates with matching issuers.
/// </summary>
public X509CertificateCollection LocalCertificates { get; internal set; }
/// <summary>
/// Remote certificate.
/// Remote certificate of the server.
/// </summary>
public X509Certificate RemoteCertificate { get; internal set; }
/// <summary>
/// Acceptable issuers.
/// Acceptable issuers mentioned by server.
/// </summary>
public string[] AcceptableIssuers { get; internal set; }
/// <summary>
/// Client Certificate.
/// Client Certificate we selected.
/// </summary>
public X509Certificate ClientCertificate { get; set; }
}
......
......@@ -5,17 +5,18 @@ using System.Security.Cryptography.X509Certificates;
namespace Titanium.Web.Proxy.EventArguments
{
/// <summary>
/// An argument passed on to the user for validating the server certificate during SSL authentication
/// An argument passed on to the user for validating the server certificate
/// during SSL authentication.
/// </summary>
public class CertificateValidationEventArgs : EventArgs
{
/// <summary>
/// Certificate
/// Server certificate.
/// </summary>
public X509Certificate Certificate { get; internal set; }
/// <summary>
/// Certificate chain
/// Certificate chain.
/// </summary>
public X509Chain Chain { get; internal set; }
......@@ -25,7 +26,7 @@ namespace Titanium.Web.Proxy.EventArguments
public SslPolicyErrors SslPolicyErrors { get; internal set; }
/// <summary>
/// is a valid certificate?
/// Is the given server certificate is valid?
/// </summary>
public bool IsValid { get; set; }
}
......
......@@ -2,6 +2,9 @@ using System;
namespace Titanium.Web.Proxy.EventArguments
{
/// <summary>
/// Wraps the data sent/received by a proxy server instance.
/// </summary>
public class DataEventArgs : EventArgs
{
internal DataEventArgs(byte[] buffer, int offset, int count)
......@@ -11,10 +14,19 @@ namespace Titanium.Web.Proxy.EventArguments
Count = count;
}
/// <summary>
/// The buffer with data.
/// </summary>
public byte[] Buffer { get; }
/// <summary>
/// Offset in Buffer where valid data begins.
/// </summary>
public int Offset { get; }
/// <summary>
/// Length from offset in Buffer with valid data.
/// </summary>
public int Count { get; }
}
}
......@@ -3,6 +3,9 @@ using Titanium.Web.Proxy.Http;
namespace Titanium.Web.Proxy.EventArguments
{
/// <summary>
/// Class that wraps the multipart sent request arguments.
/// </summary>
public class MultipartRequestPartSentEventArgs : EventArgs
{
public MultipartRequestPartSentEventArgs(string boundary, HeaderCollection headers)
......@@ -11,8 +14,14 @@ namespace Titanium.Web.Proxy.EventArguments
Headers = headers;
}
/// <summary>
/// Boundary
/// </summary>
public string Boundary { get; }
/// <summary>
/// The header collection.
/// </summary>
public HeaderCollection Headers { get; }
}
}
......@@ -15,10 +15,10 @@ using Titanium.Web.Proxy.Models;
namespace Titanium.Web.Proxy.EventArguments
{
/// <summary>
/// Holds info related to a single proxy session (single request/response sequence)
/// A proxy session is bounded to a single connection from client
/// Holds info related to a single proxy session (single request/response sequence).
/// A proxy session is bounded to a single connection from client.
/// A proxy session ends when client terminates connection to proxy
/// or when server terminates connection from proxy
/// or when server terminates connection from proxy.
/// </summary>
public class SessionEventArgs : SessionEventArgsBase
{
......@@ -47,7 +47,7 @@ namespace Titanium.Web.Proxy.EventArguments
private bool hasMulipartEventSubscribers => MultipartRequestPartSent != null;
/// <summary>
/// Should we send the request again
/// Should we send the request again ?
/// </summary>
public bool ReRequest
{
......@@ -346,9 +346,10 @@ namespace Titanium.Web.Proxy.EventArguments
}
/// <summary>
/// Gets the request body as bytes
/// Gets the request body as bytes.
/// </summary>
/// <returns></returns>
/// <param name="cancellationToken"></param>
/// <returns>The body as bytes.</returns>
public async Task<byte[]> GetRequestBody(CancellationToken cancellationToken = default)
{
if (!WebSession.Request.IsBodyRead)
......@@ -360,9 +361,10 @@ namespace Titanium.Web.Proxy.EventArguments
}
/// <summary>
/// Gets the request body as string
/// Gets the request body as string.
/// </summary>
/// <returns></returns>
/// <param name="cancellationToken">Cancellation token for this async task is optional.</param>
/// <returns>The body as string.</returns>
public async Task<string> GetRequestBodyAsString(CancellationToken cancellationToken = default)
{
if (!WebSession.Request.IsBodyRead)
......@@ -374,9 +376,9 @@ namespace Titanium.Web.Proxy.EventArguments
}
/// <summary>
/// Sets the request body
/// Sets the request body.
/// </summary>
/// <param name="body"></param>
/// <param name="body">The request body bytes.</param>
public void SetRequestBody(byte[] body)
{
var request = WebSession.Request;
......@@ -389,9 +391,9 @@ namespace Titanium.Web.Proxy.EventArguments
}
/// <summary>
/// Sets the body with the specified string
/// Sets the body with the specified string.
/// </summary>
/// <param name="body"></param>
/// <param name="body">The request body string to set.</param>
public void SetRequestBodyString(string body)
{
if (WebSession.Request.Locked)
......@@ -403,7 +405,7 @@ namespace Titanium.Web.Proxy.EventArguments
}
/// <summary>
/// Gets the response body as byte array
/// Gets the response body as bytes.
/// </summary>
/// <returns></returns>
public async Task<byte[]> GetResponseBody(CancellationToken cancellationToken = default)
......@@ -417,9 +419,9 @@ namespace Titanium.Web.Proxy.EventArguments
}
/// <summary>
/// Gets the response body as string
/// Gets the response body as string.
/// </summary>
/// <returns></returns>
/// <returns>The string body.</returns>
public async Task<string> GetResponseBodyAsString(CancellationToken cancellationToken = default)
{
if (!WebSession.Response.IsBodyRead)
......@@ -431,7 +433,7 @@ namespace Titanium.Web.Proxy.EventArguments
}
/// <summary>
/// Set the response body bytes
/// Set the response body bytes.
/// </summary>
/// <param name="body"></param>
public void SetResponseBody(byte[] body)
......@@ -446,7 +448,7 @@ namespace Titanium.Web.Proxy.EventArguments
}
/// <summary>
/// Replace the response body with the specified string
/// Replace the response body with the specified string.
/// </summary>
/// <param name="body"></param>
public void SetResponseBodyString(string body)
......@@ -462,9 +464,8 @@ namespace Titanium.Web.Proxy.EventArguments
}
/// <summary>
/// Before request is made to server
/// Respond with the specified HTML string to client
/// and ignore the request
/// Before request is made to server respond with the specified HTML string to client
/// and ignore the request.
/// </summary>
/// <param name="html"></param>
/// <param name="headers"></param>
......@@ -483,9 +484,8 @@ namespace Titanium.Web.Proxy.EventArguments
}
/// <summary>
/// Before request is made to server
/// Respond with the specified byte[] to client
/// and ignore the request
/// Before request is made to server respond with the specified byte[] to client
/// and ignore the request.
/// </summary>
/// <param name="result"></param>
/// <param name="headers"></param>
......@@ -501,9 +501,8 @@ namespace Titanium.Web.Proxy.EventArguments
/// <summary>
/// Before request is made to server 
/// Respond with the specified HTML string to client
/// and the specified status
/// and ignore the request 
/// respond with the specified HTML string and the specified status to client.
/// And then ignore the request. 
/// </summary>
/// <param name="html"></param>
/// <param name="status"></param>
......@@ -520,10 +519,8 @@ namespace Titanium.Web.Proxy.EventArguments
}
/// <summary>
/// Before request is made to server
/// Respond with the specified byte[] to client
/// and the specified status
/// and ignore the request
/// Before request is made to server respond with the specified byte[],
/// the specified status to client. And then ignore the request.
/// </summary>
/// <param name="result"></param>
/// <param name="status"></param>
......@@ -540,7 +537,7 @@ namespace Titanium.Web.Proxy.EventArguments
}
/// <summary>
/// Redirect to URL.
/// Redirect to provided URL.
/// </summary>
/// <param name="url"></param>
/// <returns></returns>
......
......@@ -2,5 +2,9 @@ using System;
namespace Titanium.Web.Proxy
{
/// <summary>
/// A delegate to catch exceptions occuring in proxy.
/// </summary>
/// <param name="exception">The exception occurred in proxy.</param>
public delegate void ExceptionHandler(Exception exception);
}
......@@ -19,47 +19,48 @@ using Titanium.Web.Proxy.Network.WinAuth.Security;
namespace Titanium.Web.Proxy
{
/// <summary>
/// Proxy Server Main class
/// 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.
/// </summary>
public partial class ProxyServer : IDisposable
{
/// <summary>
/// HTTP & HTTPS scheme shorthands.
/// </summary>
internal static readonly string UriSchemeHttp = Uri.UriSchemeHttp;
internal static readonly string UriSchemeHttps = Uri.UriSchemeHttps;
/// <summary>
/// An default exception log func
/// A default exception log func.
/// </summary>
private readonly ExceptionHandler defaultExceptionFunc = e => { };
/// <summary>
/// Backing field for corresponding public property
/// Backing field for exposed public property.
/// </summary>
private int clientConnectionCount;
/// <summary>
/// backing exception func for exposed public property
/// Backing field for exposed public property.
/// </summary>
private ExceptionHandler exceptionFunc;
/// <summary>
/// Backing field for corresponding public property
/// Backing field for exposed public property.
/// </summary>
private int serverConnectionCount;
/// <summary>
/// Manaage upstream proxy detection
/// Upstream proxy manager.
/// </summary>
private WinHttpWebProxyFinder systemProxyResolver;
/// <summary>
/// Constructor
/// Initializes a new instance of ProxyServer class with provided parameters.
/// </summary>
/// <param name="userTrustRootCertificate"></param>
/// <param name="machineTrustRootCertificate">
/// Note:setting machineTrustRootCertificate to true will force
/// userTrustRootCertificate to true
/// </param>
/// <param name="trustRootCertificateAsAdmin"></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="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,
bool trustRootCertificateAsAdmin = false) : this(null, null, userTrustRootCertificate,
machineTrustRootCertificate, trustRootCertificateAsAdmin)
......@@ -67,16 +68,13 @@ namespace Titanium.Web.Proxy
}
/// <summary>
/// Constructor.
/// Initializes a new instance of ProxyServer class with provided parameters.
/// </summary>
/// <param name="rootCertificateName">Name of root certificate.</param>
/// <param name="rootCertificateIssuerName">Name of root certificate issuer.</param>
/// <param name="userTrustRootCertificate"></param>
/// <param name="machineTrustRootCertificate">
/// Note:setting machineTrustRootCertificate to true will force
/// userTrustRootCertificate to true
/// </param>
/// <param name="trustRootCertificateAsAdmin"></param>
/// <param name="rootCertificateName">Name of the root certificate.</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="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>
public ProxyServer(string rootCertificateName, string rootCertificateIssuerName,
bool userTrustRootCertificate = true, bool machineTrustRootCertificate = false,
bool trustRootCertificateAsAdmin = false)
......@@ -96,17 +94,17 @@ namespace Titanium.Web.Proxy
}
/// <summary>
/// A object that creates tcp connection to server
/// An object that creates tcp connection to server.
/// </summary>
private TcpConnectionFactory tcpConnectionFactory { get; }
/// <summary>
/// Manage system proxy settings
/// Manage system proxy settings.
/// </summary>
private SystemProxyManager systemProxySettingsManager { get; }
/// <summary>
/// Is the proxy currently running
/// Is the proxy currently running?
/// </summary>
public bool ProxyRunning { get; private set; }
......@@ -118,52 +116,51 @@ namespace Titanium.Web.Proxy
/// <summary>
/// Enable disable Windows Authentication (NTLM/Kerberos)
/// Note: NTLM/Kerberos will always send local credentials of current user
/// who is running the proxy process. This is because a man
/// in middle attack is not currently supported
/// (which would require windows delegation enabled for this server process)
/// running the proxy process. This is because a man
/// in middle attack with Windows domain authentication is not currently supported.
/// </summary>
public bool EnableWinAuth { get; set; }
/// <summary>
/// Should we check for certificare revocation during SSL authentication to servers
/// Note: If enabled can reduce performance (Default: NoCheck)
/// Note: If enabled can reduce performance. Defaults to false.
/// </summary>
public X509RevocationMode CheckCertificateRevocation { get; set; }
/// <summary>
/// Does this proxy uses the HTTP protocol 100 continue behaviour strictly?
/// Broken 100 contunue implementations on server/client may cause problems if enabled
/// Broken 100 contunue implementations on server/client may cause problems if enabled.
/// </summary>
public bool Enable100ContinueBehaviour { get; set; }
/// <summary>
/// Buffer size used throughout this proxy
/// Buffer size used throughout this proxy.
/// </summary>
public int BufferSize { get; set; } = 8192;
/// <summary>
/// Seconds client/server connection are to be kept alive when waiting for read/write to complete
/// Seconds client/server connection are to be kept alive when waiting for read/write to complete.
/// </summary>
public int ConnectionTimeOutSeconds { get; set; }
/// <summary>
/// Total number of active client connections
/// Total number of active client connections.
/// </summary>
public int ClientConnectionCount => clientConnectionCount;
/// <summary>
/// Total number of active server connections
/// Total number of active server connections.
/// </summary>
public int ServerConnectionCount => serverConnectionCount;
/// <summary>
/// Realm used during Proxy Basic Authentication
/// Realm used during Proxy Basic Authentication.
/// </summary>
public string ProxyRealm { get; set; } = "TitaniumProxy";
/// <summary>
/// List of supported Ssl versions
/// List of supported Ssl versions.
/// </summary>
public SslProtocols SupportedSslProtocols { get; set; } =
#if NET45
......@@ -173,39 +170,39 @@ namespace Titanium.Web.Proxy
/// <summary>
/// Manages certificates used by this proxy
/// Manages certificates used by this proxy.
/// </summary>
public CertificateManager CertificateManager { get; }
/// <summary>
/// External proxy for Http
/// External proxy used for Http requests.
/// </summary>
public ExternalProxy UpStreamHttpProxy { get; set; }
/// <summary>
/// External proxy for Http
/// External proxy used for Https requests.
/// </summary>
public ExternalProxy UpStreamHttpsProxy { get; set; }
/// <summary>
/// Local adapter/NIC endpoint (where proxy makes request via)
/// default via any IP addresses of this machine
/// Local adapter/NIC endpoint where proxy makes request via.
/// Defaults via any IP addresses of this machine.
/// </summary>
public IPEndPoint UpStreamEndPoint { get; set; } = new IPEndPoint(IPAddress.Any, 0);
/// <summary>
/// A list of IpAddress and port this proxy is listening to
/// A list of IpAddress and port this proxy is listening to.
/// </summary>
public List<ProxyEndPoint> ProxyEndPoints { get; set; }
/// <summary>
/// A callback to provide authentication credentials for up stream proxy this proxy is using for HTTP(S) requests
/// return the ExternalProxy object with valid credentials
/// A callback to provide authentication credentials for up stream proxy this proxy is using for HTTP(S) requests.
/// User should return the ExternalProxy object with valid credentials.
/// </summary>
public Func<SessionEventArgsBase, Task<ExternalProxy>> GetCustomUpStreamProxyFunc { get; set; }
/// <summary>
/// Callback for error events in proxy
/// Callback for error events in this proxy instance.
/// </summary>
public ExceptionHandler ExceptionFunc
{
......@@ -214,9 +211,9 @@ namespace Titanium.Web.Proxy
}
/// <summary>
/// A callback to authenticate clients
/// Parameters are username, password provided by client
/// return true for successful authentication
/// A callback to authenticate clients.
/// Parameters are username & password as provided by client.
/// Return true for successful authentication.
/// </summary>
public Func<string, string, Task<bool>> AuthenticateUserFunc { get; set; }
......@@ -244,34 +241,34 @@ namespace Titanium.Web.Proxy
public event EventHandler ServerConnectionCountChanged;
/// <summary>
/// Verifies the remote Secure Sockets Layer (SSL) certificate used for authentication
/// Verifies the remote SSL certificate used for authentication.
/// </summary>
public event AsyncEventHandler<CertificateValidationEventArgs> ServerCertificateValidationCallback;
/// <summary>
/// Callback tooverride client certificate during SSL mutual authentication
/// Callback to override client certificate selection during mutual SSL authentication.
/// </summary>
public event AsyncEventHandler<CertificateSelectionEventArgs> ClientCertificateSelectionCallback;
/// <summary>
/// Intercept request to server
/// Intercept request to server.
/// </summary>
public event AsyncEventHandler<SessionEventArgs> BeforeRequest;
/// <summary>
/// Intercept response from server
/// Intercept response from server.
/// </summary>
public event AsyncEventHandler<SessionEventArgs> BeforeResponse;
/// <summary>
/// Intercept after response from server
/// Intercept after response from server.
/// </summary>
public event AsyncEventHandler<SessionEventArgs> AfterResponse;
/// <summary>
/// Add a proxy end point
/// Add a proxy end point.
/// </summary>
/// <param name="endPoint"></param>
/// <param name="endPoint">The proxy endpoint.</param>
public void AddEndPoint(ProxyEndPoint endPoint)
{
if (ProxyEndPoints.Any(x =>
......@@ -289,10 +286,10 @@ namespace Titanium.Web.Proxy
}
/// <summary>
/// Remove a proxy end point
/// Remove a proxy end point.
/// Will throw error if the end point does'nt exist
/// </summary>
/// <param name="endPoint"></param>
/// <param name="endPoint">The existing endpoint to remove.</param>
public void RemoveEndPoint(ProxyEndPoint endPoint)
{
if (ProxyEndPoints.Contains(endPoint) == false)
......@@ -309,7 +306,7 @@ namespace Titanium.Web.Proxy
}
/// <summary>
/// Set the given explicit end point as the default proxy server for current machine
/// Set the given explicit end point as the default proxy server for current machine.
/// </summary>
/// <param name="endPoint"></param>
public void SetAsSystemHttpProxy(ExplicitProxyEndPoint endPoint)
......@@ -318,7 +315,7 @@ namespace Titanium.Web.Proxy
}
/// <summary>
/// Set the given explicit end point as the default proxy server for current machine
/// Set the given explicit end point as the default proxy server for current machine.
/// </summary>
/// <param name="endPoint"></param>
public void SetAsSystemHttpsProxy(ExplicitProxyEndPoint endPoint)
......@@ -327,7 +324,7 @@ namespace Titanium.Web.Proxy
}
/// <summary>
/// Set the given explicit end point as the default proxy server for current machine
/// Set the given explicit end point as the default proxy server for current machine.
/// </summary>
/// <param name="endPoint"></param>
/// <param name="protocolType"></param>
......@@ -406,7 +403,7 @@ namespace Titanium.Web.Proxy
}
/// <summary>
/// Remove any HTTP proxy setting of current machien
/// Clear HTTP proxy settings of current machine.
/// </summary>
public void DisableSystemHttpProxy()
{
......@@ -414,7 +411,7 @@ namespace Titanium.Web.Proxy
}
/// <summary>
/// Remove any HTTPS proxy setting for current machine
/// Clear HTTPS proxy settings of current machine.
/// </summary>
public void DisableSystemHttpsProxy()
{
......@@ -422,7 +419,7 @@ namespace Titanium.Web.Proxy
}
/// <summary>
/// Remove the specified proxy settings for current machine
/// Clear the specified proxy setting for current machine.
/// </summary>
public void DisableSystemProxy(ProxyProtocolType protocolType)
{
......@@ -435,7 +432,7 @@ namespace Titanium.Web.Proxy
}
/// <summary>
/// Clear all proxy settings for current machine
/// Clear all proxy settings for current machine.
/// </summary>
public void DisableAllSystemProxies()
{
......@@ -448,7 +445,7 @@ namespace Titanium.Web.Proxy
}
/// <summary>
/// Start this proxy server
/// Start this proxy server instance.
/// </summary>
public void Start()
{
......@@ -512,7 +509,7 @@ namespace Titanium.Web.Proxy
}
/// <summary>
/// Stop this proxy server
/// Stop this proxy server instance.
/// </summary>
public void Stop()
{
......@@ -545,9 +542,9 @@ namespace Titanium.Web.Proxy
}
/// <summary>
/// Listen on the given end point on local machine
/// Listen on given end point of local machine.
/// </summary>
/// <param name="endPoint"></param>
/// <param name="endPoint">The end point to listen.</param>
private void Listen(ProxyEndPoint endPoint)
{
endPoint.Listener = new TcpListener(endPoint.IpAddress, endPoint.Port);
......@@ -571,9 +568,9 @@ namespace Titanium.Web.Proxy
}
/// <summary>
/// Verifiy if its safe to set this end point as System proxy
/// Verify if its safe to set this end point as system proxy.
/// </summary>
/// <param name="endPoint"></param>
/// <param name="endPoint">The end point to validate.</param>
private void ValidateEndPointAsSystemProxy(ExplicitProxyEndPoint endPoint)
{
if (endPoint == null)
......@@ -593,13 +590,8 @@ namespace Titanium.Web.Proxy
}
/// <summary>
/// Gets the system up stream proxy.
/// Gets the system up stream proxy.
/// </summary>
/// <param name="sessionEventArgs">The <see cref="SessionEventArgs" /> instance containing the event data.</param>
/// <returns>
/// <see cref="ExternalProxy" /> instance containing valid proxy configuration from PAC/WAPD scripts if any
/// exists.
/// </returns>
private Task<ExternalProxy> GetSystemUpStreamProxy(SessionEventArgsBase sessionEventArgs)
{
var proxy = systemProxyResolver.GetProxy(sessionEventArgs.WebSession.Request.RequestUri);
......@@ -607,9 +599,8 @@ namespace Titanium.Web.Proxy
}
/// <summary>
/// When a connection is received from client act
/// Act when a connection is received from client.
/// </summary>
/// <param name="asyn"></param>
private void OnAcceptConnection(IAsyncResult asyn)
{
var endPoint = (ProxyEndPoint)asyn.AsyncState;
......@@ -668,16 +659,14 @@ namespace Titanium.Web.Proxy
}
/// <summary>
/// Quit listening on the given end point
/// Quit listening on the given end point.
/// </summary>
/// <param name="endPoint"></param>
private void QuitListen(ProxyEndPoint endPoint)
{
endPoint.Listener.Stop();
endPoint.Listener.Server.Dispose();
}
internal void UpdateClientConnectionCount(bool increment)
{
if (increment)
......
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