From f4afd16126dfc80f14b8c3d0790f2ce49168dc4d Mon Sep 17 00:00:00 2001 From: Honfika Date: Tue, 24 Dec 2019 19:14:45 +0100 Subject: [PATCH 01/10] SOCKS support --- .../ProxyTestController.cs | 8 +- .../Extensions/TcpExtensions.cs | 26 +- src/Titanium.Web.Proxy/Http/HttpWebClient.cs | 25 +- .../Models/ExternalProxy.cs | 14 + .../Models/IExternalProxy.cs | 2 + .../Network/Tcp/TcpClientConnection.cs | 22 +- .../Network/Tcp/TcpConnectionFactory.cs | 155 +++-- .../Network/Tcp/TcpServerConnection.cs | 16 +- src/Titanium.Web.Proxy/ProxyServer.cs | 34 +- .../ProxySocket/Authentication/AuthMethod.cs | 134 +++++ .../ProxySocket/Authentication/AuthNone.cs | 65 +++ .../Authentication/AuthUserPass.cs | 204 +++++++ .../ProxySocket/HttpsHandler.cs | 355 ++++++++++++ .../ProxySocket/IAsyncProxyResult.cs | 116 ++++ .../ProxySocket/ProxyException.cs | 90 +++ .../ProxySocket/ProxySocket.cs | 529 +++++++++++++++++ .../ProxySocket/Socks4Handler.cs | 273 +++++++++ .../ProxySocket/Socks5Handler.cs | 534 ++++++++++++++++++ .../ProxySocket/SocksHandler.cs | 279 +++++++++ 19 files changed, 2772 insertions(+), 109 deletions(-) create mode 100644 src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthMethod.cs create mode 100644 src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthNone.cs create mode 100644 src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthUserPass.cs create mode 100644 src/Titanium.Web.Proxy/ProxySocket/HttpsHandler.cs create mode 100644 src/Titanium.Web.Proxy/ProxySocket/IAsyncProxyResult.cs create mode 100644 src/Titanium.Web.Proxy/ProxySocket/ProxyException.cs create mode 100644 src/Titanium.Web.Proxy/ProxySocket/ProxySocket.cs create mode 100644 src/Titanium.Web.Proxy/ProxySocket/Socks4Handler.cs create mode 100644 src/Titanium.Web.Proxy/ProxySocket/Socks5Handler.cs create mode 100644 src/Titanium.Web.Proxy/ProxySocket/SocksHandler.cs diff --git a/examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs b/examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs index f7ffeb7b9..890e93987 100644 --- a/examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs +++ b/examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs @@ -90,8 +90,12 @@ public void StartProxy() //}; //proxyServer.AddEndPoint(transparentEndPoint); - //proxyServer.UpStreamHttpProxy = new ExternalProxy() { HostName = "localhost", Port = 8888 }; - //proxyServer.UpStreamHttpsProxy = new ExternalProxy() { HostName = "localhost", Port = 8888 }; + //proxyServer.UpStreamHttpProxy = new ExternalProxy("localhost", 8888); + //proxyServer.UpStreamHttpsProxy = new ExternalProxy("localhost", 8888( }); + + // SOCKS proxy + //proxyServer.UpStreamHttpProxy = new ExternalProxy("46.63.0.17", 4145) { ProxyType = ExternalProxyType.Socks4 }; + //proxyServer.UpStreamHttpsProxy = new ExternalProxy("46.63.0.17", 4145) { ProxyType = ExternalProxyType.Socks4 }; foreach (var endPoint in proxyServer.ProxyEndPoints) { diff --git a/src/Titanium.Web.Proxy/Extensions/TcpExtensions.cs b/src/Titanium.Web.Proxy/Extensions/TcpExtensions.cs index a4d07e3ba..4e7a41aea 100644 --- a/src/Titanium.Web.Proxy/Extensions/TcpExtensions.cs +++ b/src/Titanium.Web.Proxy/Extensions/TcpExtensions.cs @@ -5,24 +5,6 @@ namespace Titanium.Web.Proxy.Extensions { internal static class TcpExtensions { - internal static void CloseSocket(this TcpClient tcpClient) - { - if (tcpClient == null) - { - return; - } - - try - { - tcpClient.Close(); - } - catch - { - // ignored - } - } - - /// /// Check if a TcpClient is good to be used. /// This only checks if send is working so local socket is still connected. @@ -30,13 +12,11 @@ internal static void CloseSocket(this TcpClient tcpClient) /// So in our case we should retry with new connection from pool if first read after getting the connection fails. /// https://msdn.microsoft.com/en-us/library/system.net.sockets.socket.connected(v=vs.110).aspx /// - /// + /// /// - internal static bool IsGoodConnection(this TcpClient client) + internal static bool IsGoodConnection(this Socket socket) { - var socket = client.Client; - - if (!client.Connected || !socket.Connected) + if (!socket.Connected) { return false; } diff --git a/src/Titanium.Web.Proxy/Http/HttpWebClient.cs b/src/Titanium.Web.Proxy/Http/HttpWebClient.cs index 092728095..b027c3d44 100644 --- a/src/Titanium.Web.Proxy/Http/HttpWebClient.cs +++ b/src/Titanium.Web.Proxy/Http/HttpWebClient.cs @@ -2,6 +2,7 @@ using System.Net; using System.Threading; using System.Threading.Tasks; +using Titanium.Web.Proxy.Models; using Titanium.Web.Proxy.Network.Tcp; namespace Titanium.Web.Proxy.Http @@ -103,10 +104,14 @@ internal async Task SendRequest(bool enable100ContinueBehaviour, bool isTranspar { var upstreamProxy = Connection.UpStreamProxy; - bool useUpstreamProxy = upstreamProxy != null && Connection.IsHttps == false; + bool useUpstreamProxy = upstreamProxy != null && upstreamProxy.ProxyType == ExternalProxyType.Http && + !Connection.IsHttps; var serverStream = Connection.Stream; + string? upstreamProxyUserName = null; + string? upstreamProxyPassword = null; + string url; if (!useUpstreamProxy || isTransparent) { @@ -115,19 +120,13 @@ internal async Task SendRequest(bool enable100ContinueBehaviour, bool isTranspar else { url = Request.RequestUri.ToString(); - } - - string? upstreamProxyUserName = null; - string? upstreamProxyPassword = null; - // Send Authentication to Upstream proxy if needed - if (!isTransparent && upstreamProxy != null - && Connection.IsHttps == false - && !string.IsNullOrEmpty(upstreamProxy.UserName) - && upstreamProxy.Password != null) - { - upstreamProxyUserName = upstreamProxy.UserName; - upstreamProxyPassword = upstreamProxy.Password; + // Send Authentication to Upstream proxy if needed + if (!string.IsNullOrEmpty(upstreamProxy!.UserName) && upstreamProxy.Password != null) + { + upstreamProxyUserName = upstreamProxy.UserName; + upstreamProxyPassword = upstreamProxy.Password; + } } // prepare the request & headers diff --git a/src/Titanium.Web.Proxy/Models/ExternalProxy.cs b/src/Titanium.Web.Proxy/Models/ExternalProxy.cs index 70ae99caf..3f09aee62 100644 --- a/src/Titanium.Web.Proxy/Models/ExternalProxy.cs +++ b/src/Titanium.Web.Proxy/Models/ExternalProxy.cs @@ -25,6 +25,8 @@ public class ExternalProxy : IExternalProxy /// public bool BypassLocalhost { get; set; } + public ExternalProxyType ProxyType { get; set; } + /// /// Username. /// @@ -111,4 +113,16 @@ public override string ToString() return $"{HostName}:{Port}"; } } + + public enum ExternalProxyType + { + /// A HTTP/HTTPS proxy server. + Http, + + /// A SOCKS4[A] proxy server. + Socks4, + + /// A SOCKS5 proxy server. + Socks5 + } } diff --git a/src/Titanium.Web.Proxy/Models/IExternalProxy.cs b/src/Titanium.Web.Proxy/Models/IExternalProxy.cs index 7eb877859..cbfe6e41c 100644 --- a/src/Titanium.Web.Proxy/Models/IExternalProxy.cs +++ b/src/Titanium.Web.Proxy/Models/IExternalProxy.cs @@ -12,6 +12,8 @@ public interface IExternalProxy /// bool BypassLocalhost { get; set; } + ExternalProxyType ProxyType { get; set; } + /// /// Username. /// diff --git a/src/Titanium.Web.Proxy/Network/Tcp/TcpClientConnection.cs b/src/Titanium.Web.Proxy/Network/Tcp/TcpClientConnection.cs index 9e351a522..7e55681a8 100644 --- a/src/Titanium.Web.Proxy/Network/Tcp/TcpClientConnection.cs +++ b/src/Titanium.Web.Proxy/Network/Tcp/TcpClientConnection.cs @@ -18,9 +18,9 @@ internal class TcpClientConnection : IDisposable { public object ClientUserData { get; set; } - internal TcpClientConnection(ProxyServer proxyServer, TcpClient tcpClient) + internal TcpClientConnection(ProxyServer proxyServer, Socket tcpClientSocket) { - this.tcpClient = tcpClient; + this.tcpClientSocket = tcpClientSocket; this.proxyServer = proxyServer; this.proxyServer.UpdateClientConnectionCount(true); } @@ -29,21 +29,21 @@ internal TcpClientConnection(ProxyServer proxyServer, TcpClient tcpClient) public Guid Id { get; } = Guid.NewGuid(); - public EndPoint LocalEndPoint => tcpClient.Client.LocalEndPoint; + public EndPoint LocalEndPoint => tcpClientSocket.LocalEndPoint; - public EndPoint RemoteEndPoint => tcpClient.Client.RemoteEndPoint; + public EndPoint RemoteEndPoint => tcpClientSocket.RemoteEndPoint; internal SslProtocols SslProtocol { get; set; } internal SslApplicationProtocol NegotiatedApplicationProtocol { get; set; } - private readonly TcpClient tcpClient; + private readonly Socket tcpClientSocket; private int? processId; public Stream GetStream() { - return tcpClient.GetStream(); + return new NetworkStream(tcpClientSocket, true); } public int GetProcessId(ProxyEndPoint endPoint) @@ -86,7 +86,15 @@ public void Dispose() // This way we can push tcp Time_Wait to client side when possible. await Task.Delay(1000); proxyServer.UpdateClientConnectionCount(false); - tcpClient.CloseSocket(); + + try + { + tcpClientSocket.Close(); + } + catch + { + // ignore + } }); } } diff --git a/src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs b/src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs index 62d9e935e..28ff98c5f 100644 --- a/src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs +++ b/src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs @@ -15,6 +15,7 @@ using Titanium.Web.Proxy.Helpers; using Titanium.Web.Proxy.Http; using Titanium.Web.Proxy.Models; +using Titanium.Web.Proxy.ProxySocket; namespace Titanium.Web.Proxy.Network.Tcp { @@ -85,6 +86,8 @@ internal string GetConnectionCacheKey(string remoteHostName, int remotePort, cacheKeyBuilder.Append(externalProxy.HostName); cacheKeyBuilder.Append("-"); cacheKeyBuilder.Append(externalProxy.Port); + cacheKeyBuilder.Append("-"); + cacheKeyBuilder.Append(externalProxy.ProxyType); if (externalProxy.UseDefaultCredentials) { @@ -114,7 +117,7 @@ internal async Task GetConnectionCacheKey(ProxyServer server, SessionEve applicationProtocols = new List { applicationProtocol }; } - IExternalProxy? customUpStreamProxy = session.CustomUpStreamProxy; + var customUpStreamProxy = session.CustomUpStreamProxy; bool isHttps = session.IsHttps; if (customUpStreamProxy == null && server.GetCustomUpStreamProxyFunc != null) @@ -125,12 +128,10 @@ internal async Task GetConnectionCacheKey(ProxyServer server, SessionEve session.CustomUpStreamProxyUsed = customUpStreamProxy; var uri = session.HttpClient.Request.RequestUri; - return GetConnectionCacheKey( - uri.Host, - uri.Port, - isHttps, applicationProtocols, - session.HttpClient.UpStreamEndPoint ?? server.UpStreamEndPoint, - customUpStreamProxy ?? (isHttps ? server.UpStreamHttpsProxy : server.UpStreamHttpProxy)); + var upStreamEndPoint = session.HttpClient.UpStreamEndPoint ?? server.UpStreamEndPoint; + var upStreamProxy = customUpStreamProxy ?? (isHttps ? server.UpStreamHttpsProxy : server.UpStreamHttpProxy); + return GetConnectionCacheKey(uri.Host, uri.Port, isHttps, applicationProtocols, upStreamEndPoint, + upStreamProxy); } @@ -169,7 +170,7 @@ internal Task GetServerConnection(ProxyServer proxyServer, internal async Task GetServerConnection(ProxyServer proxyServer, SessionEventArgsBase session, bool isConnect, List? applicationProtocols, bool noCache, CancellationToken cancellationToken) { - IExternalProxy? customUpStreamProxy = session.CustomUpStreamProxy; + var customUpStreamProxy = session.CustomUpStreamProxy; bool isHttps = session.IsHttps; if (customUpStreamProxy == null && proxyServer.GetCustomUpStreamProxyFunc != null) @@ -204,13 +205,10 @@ internal async Task GetServerConnection(ProxyServer proxySe port = uri.Port; } - return await GetServerConnection( - proxyServer, host, port, - session.HttpClient.Request.HttpVersion, - isHttps, applicationProtocols, isConnect, - session, session.HttpClient.UpStreamEndPoint ?? proxyServer.UpStreamEndPoint, - customUpStreamProxy ?? (isHttps ? proxyServer.UpStreamHttpsProxy : proxyServer.UpStreamHttpProxy), - noCache, cancellationToken); + var upStreamEndPoint = session.HttpClient.UpStreamEndPoint ?? proxyServer.UpStreamEndPoint; + var upStreamProxy = customUpStreamProxy ?? (isHttps ? proxyServer.UpStreamHttpsProxy : proxyServer.UpStreamHttpProxy); + return await GetServerConnection(proxyServer, host, port, session.HttpClient.Request.HttpVersion, isHttps, + applicationProtocols, isConnect, session, upStreamEndPoint, upStreamProxy, noCache, cancellationToken); } /// @@ -249,7 +247,7 @@ internal async Task GetServerConnection(ProxyServer proxySe if (existingConnections.TryDequeue(out var recentConnection)) { if (recentConnection.LastAccess > cutOff - && recentConnection.TcpClient.IsGoodConnection()) + && recentConnection.TcpSocket.IsGoodConnection()) { return recentConnection; } @@ -323,7 +321,7 @@ private async Task createServerConnection(string remoteHost externalProxy = null; } - TcpClient? tcpClient = null; + Socket? tcpServerSocket = null; HttpServerStream? stream = null; SslApplicationProtocol negotiatedApplicationProtocol = default; @@ -334,8 +332,15 @@ private async Task createServerConnection(string remoteHost retry: try { - string hostname = externalProxy != null ? externalProxy.HostName : remoteHostName; - int port = externalProxy?.Port ?? remotePort; + bool socks = externalProxy != null && externalProxy.ProxyType != ExternalProxyType.Http; + string hostname = remoteHostName; + int port = remotePort; + + if (externalProxy != null && externalProxy.ProxyType == ExternalProxyType.Http) + { + hostname = externalProxy.HostName; + port = externalProxy.Port; + } var ipAddresses = await Dns.GetHostAddressesAsync(hostname); if (ipAddresses == null || ipAddresses.Length == 0) @@ -356,28 +361,92 @@ private async Task createServerConnection(string remoteHost try { var ipAddress = ipAddresses[i]; - if (upStreamEndPoint == null) + var addressFamily = upStreamEndPoint?.AddressFamily ?? ipAddress.AddressFamily; + + if (socks) { - tcpClient = new TcpClient(ipAddress.AddressFamily); + var proxySocket = new ProxySocket.ProxySocket(addressFamily, SocketType.Stream, ProtocolType.Tcp); + proxySocket.ProxyType = externalProxy!.ProxyType == ExternalProxyType.Socks4 + ? ProxyTypes.Socks4 + : ProxyTypes.Socks5; + + var proxyIpAddresses = await Dns.GetHostAddressesAsync(externalProxy.HostName); + proxySocket.ProxyEndPoint = new IPEndPoint(proxyIpAddresses[0], externalProxy.Port); + if (!string.IsNullOrEmpty(externalProxy.UserName) && externalProxy.Password != null) + { + proxySocket.ProxyUser = externalProxy.UserName; + proxySocket.ProxyPass = externalProxy.Password; + } + + tcpServerSocket = proxySocket; } else { - tcpClient = new TcpClient(upStreamEndPoint); + tcpServerSocket = new Socket(addressFamily, SocketType.Stream, ProtocolType.Tcp); } - tcpClient.NoDelay = proxyServer.NoDelay; - tcpClient.ReceiveTimeout = proxyServer.ConnectionTimeOutSeconds * 1000; - tcpClient.SendTimeout = proxyServer.ConnectionTimeOutSeconds * 1000; - tcpClient.LingerState = new LingerOption(true, proxyServer.TcpTimeWaitSeconds); + tcpServerSocket.NoDelay = proxyServer.NoDelay; + tcpServerSocket.ReceiveTimeout = proxyServer.ConnectionTimeOutSeconds * 1000; + tcpServerSocket.SendTimeout = proxyServer.ConnectionTimeOutSeconds * 1000; + tcpServerSocket.LingerState = new LingerOption(true, proxyServer.TcpTimeWaitSeconds); if (proxyServer.ReuseSocket && RunTime.IsSocketReuseAvailable) { - tcpClient.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); + tcpServerSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); + } + + Task connectTask; + if (socks) + { + var clientSocket = (ProxySocket.ProxySocket)tcpServerSocket; + + IAsyncResult BeginConnect(IPAddress address, int port, AsyncCallback requestCallback, + object state) + { + return clientSocket.BeginConnect(address, port, requestCallback, state); + } + + void EndConnect(IAsyncResult asyncResult) + { + var s = clientSocket; + if (s == null) + { + // Dispose nulls out the client socket field. + throw new ObjectDisposedException(GetType().Name); + } + + s.EndConnect(asyncResult); + } + + connectTask = Task.Factory.FromAsync(BeginConnect, EndConnect, ipAddress, port, state: this); + } + else + { + var clientSocket = tcpServerSocket; + + IAsyncResult BeginConnect(IPAddress address, int port, AsyncCallback requestCallback, + object state) + { + return clientSocket.BeginConnect(address, port, requestCallback, state); + } + + void EndConnect(IAsyncResult asyncResult) + { + var s = clientSocket; + if (s == null) + { + // Dispose nulls out the client socket field. + throw new ObjectDisposedException(GetType().Name); + } + + s.EndConnect(asyncResult); + } + + connectTask = Task.Factory.FromAsync(BeginConnect, EndConnect, ipAddress, port, state: this); } - var connectTask = tcpClient.ConnectAsync(ipAddress, port); - await Task.WhenAny(connectTask, Task.Delay(proxyServer.ConnectTimeOutSeconds * 1000)); - if (!connectTask.IsCompleted || !tcpClient.Connected) + await Task.WhenAny(connectTask, Task.Delay(proxyServer.ConnectTimeOutSeconds * 1000, cancellationToken)); + if (!connectTask.IsCompleted || !tcpServerSocket.Connected) { // here we can just do some cleanup and let the loop continue since // we will either get a connection or wind up with a null tcpClient @@ -393,11 +462,11 @@ private async Task createServerConnection(string remoteHost try { #if NET45 - tcpClient?.Close(); + tcpServerSocket?.Close(); #else - tcpClient?.Dispose(); + tcpServerSocket?.Dispose(); #endif - tcpClient = null; + tcpServerSocket = null; } catch { @@ -414,15 +483,15 @@ private async Task createServerConnection(string remoteHost // dispose the current TcpClient and try the next address lastException = e; #if NET45 - tcpClient?.Close(); + tcpServerSocket?.Close(); #else - tcpClient?.Dispose(); + tcpServerSocket?.Dispose(); #endif - tcpClient = null; + tcpServerSocket = null; } } - if (tcpClient == null) + if (tcpServerSocket == null) { if (sessionArgs != null && proxyServer.CustomUpStreamProxyFailureFunc != null) { @@ -443,11 +512,11 @@ private async Task createServerConnection(string remoteHost sessionArgs.TimeLine["Connection Established"] = DateTime.Now; } - await proxyServer.InvokeServerConnectionCreateEvent(tcpClient); + await proxyServer.InvokeServerConnectionCreateEvent(tcpServerSocket); - stream = new HttpServerStream(tcpClient.GetStream(), proxyServer.BufferPool, cancellationToken); + stream = new HttpServerStream(new NetworkStream(tcpServerSocket, true), proxyServer.BufferPool, cancellationToken); - if (externalProxy != null && (isConnect || isHttps)) + if ((externalProxy != null && externalProxy.ProxyType == ExternalProxyType.Http) && (isConnect || isHttps)) { var authority = $"{remoteHostName}:{remotePort}".GetByteString(); var connectRequest = new ConnectRequest(authority) @@ -511,7 +580,7 @@ private async Task createServerConnection(string remoteHost catch (IOException ex) when (ex.HResult == unchecked((int)0x80131620) && retry && enabledSslProtocols >= SslProtocols.Tls11) { stream?.Dispose(); - tcpClient?.Close(); + tcpServerSocket?.Close(); enabledSslProtocols = SslProtocols.Tls; retry = false; @@ -520,11 +589,11 @@ private async Task createServerConnection(string remoteHost catch (Exception) { stream?.Dispose(); - tcpClient?.Close(); + tcpServerSocket?.Close(); throw; } - return new TcpServerConnection(proxyServer, tcpClient, stream, remoteHostName, remotePort, isHttps, + return new TcpServerConnection(proxyServer, tcpServerSocket, stream, remoteHostName, remotePort, isHttps, negotiatedApplicationProtocol, httpVersion, externalProxy, upStreamEndPoint, cacheKey); } diff --git a/src/Titanium.Web.Proxy/Network/Tcp/TcpServerConnection.cs b/src/Titanium.Web.Proxy/Network/Tcp/TcpServerConnection.cs index 1031eecbd..fd67928ba 100644 --- a/src/Titanium.Web.Proxy/Network/Tcp/TcpServerConnection.cs +++ b/src/Titanium.Web.Proxy/Network/Tcp/TcpServerConnection.cs @@ -16,11 +16,11 @@ internal class TcpServerConnection : IDisposable { public Guid Id { get; } = Guid.NewGuid(); - internal TcpServerConnection(ProxyServer proxyServer, TcpClient tcpClient, HttpServerStream stream, + internal TcpServerConnection(ProxyServer proxyServer, Socket tcpSocket, HttpServerStream stream, string hostName, int port, bool isHttps, SslApplicationProtocol negotiatedApplicationProtocol, Version version, IExternalProxy? upStreamProxy, IPEndPoint? upStreamEndPoint, string cacheKey) { - TcpClient = tcpClient; + TcpSocket = tcpSocket; LastAccess = DateTime.Now; this.proxyServer = proxyServer; this.proxyServer.UpdateServerConnectionCount(true); @@ -63,7 +63,7 @@ internal TcpServerConnection(ProxyServer proxyServer, TcpClient tcpClient, HttpS /// /// The TcpClient. /// - internal TcpClient TcpClient { get; } + internal Socket TcpSocket { get; } /// /// Used to write lines to server @@ -98,7 +98,15 @@ public void Dispose() await Task.Delay(1000); proxyServer.UpdateServerConnectionCount(false); Stream.Dispose(); - TcpClient.CloseSocket(); + + try + { + TcpSocket.Close(); + } + catch + { + // ignore + } }); } diff --git a/src/Titanium.Web.Proxy/ProxyServer.cs b/src/Titanium.Web.Proxy/ProxyServer.cs index 23ddedd40..d1f4a37a3 100644 --- a/src/Titanium.Web.Proxy/ProxyServer.cs +++ b/src/Titanium.Web.Proxy/ProxyServer.cs @@ -359,12 +359,12 @@ public ExceptionHandler ExceptionFunc /// /// Customize TcpClient used for client connection upon create. /// - public event AsyncEventHandler? OnClientConnectionCreate; + public event AsyncEventHandler? OnClientConnectionCreate; /// /// Customize TcpClient used for server connection upon create. /// - public event AsyncEventHandler? OnServerConnectionCreate; + public event AsyncEventHandler? OnServerConnectionCreate; /// /// Customize the minimum ThreadPool size (increase it on a server) @@ -733,12 +733,12 @@ private void onAcceptConnection(IAsyncResult asyn) { var endPoint = (ProxyEndPoint)asyn.AsyncState; - TcpClient? tcpClient = null; + Socket? tcpClient = null; try { // based on end point type call appropriate request handlers - tcpClient = endPoint.Listener!.EndAcceptTcpClient(asyn); + tcpClient = endPoint.Listener!.EndAcceptSocket(asyn); tcpClient.NoDelay = NoDelay; } catch (ObjectDisposedException) @@ -784,19 +784,19 @@ private void setThreadPoolMinThread(int workerThreads) /// /// Handle the client. /// - /// The client. + /// The client socket. /// The proxy endpoint. /// The task. - private async Task handleClient(TcpClient tcpClient, ProxyEndPoint endPoint) + private async Task handleClient(Socket tcpClientSocket, ProxyEndPoint endPoint) { - tcpClient.ReceiveTimeout = ConnectionTimeOutSeconds * 1000; - tcpClient.SendTimeout = ConnectionTimeOutSeconds * 1000; + tcpClientSocket.ReceiveTimeout = ConnectionTimeOutSeconds * 1000; + tcpClientSocket.SendTimeout = ConnectionTimeOutSeconds * 1000; - tcpClient.LingerState = new LingerOption(true, TcpTimeWaitSeconds); + tcpClientSocket.LingerState = new LingerOption(true, TcpTimeWaitSeconds); - await InvokeClientConnectionCreateEvent(tcpClient); + await InvokeClientConnectionCreateEvent(tcpClientSocket); - using (var clientConnection = new TcpClientConnection(this, tcpClient)) + using (var clientConnection = new TcpClientConnection(this, tcpClientSocket)) { if (endPoint is TransparentProxyEndPoint tep) { @@ -867,28 +867,28 @@ internal void UpdateServerConnectionCount(bool increment) /// /// Invoke client tcp connection events if subscribed by API user. /// - /// The TcpClient object. + /// The TcpClient object. /// - internal async Task InvokeClientConnectionCreateEvent(TcpClient client) + internal async Task InvokeClientConnectionCreateEvent(Socket clientSocket) { // client connection created if (OnClientConnectionCreate != null) { - await OnClientConnectionCreate.InvokeAsync(this, client, ExceptionFunc); + await OnClientConnectionCreate.InvokeAsync(this, clientSocket, ExceptionFunc); } } /// /// Invoke server tcp connection events if subscribed by API user. /// - /// The TcpClient object. + /// The Socket object. /// - internal async Task InvokeServerConnectionCreateEvent(TcpClient client) + internal async Task InvokeServerConnectionCreateEvent(Socket serverSocket) { // server connection created if (OnServerConnectionCreate != null) { - await OnServerConnectionCreate.InvokeAsync(this, client, ExceptionFunc); + await OnServerConnectionCreate.InvokeAsync(this, serverSocket, ExceptionFunc); } } diff --git a/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthMethod.cs b/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthMethod.cs new file mode 100644 index 000000000..4ead58437 --- /dev/null +++ b/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthMethod.cs @@ -0,0 +1,134 @@ +/* + Copyright © 2002, The KPD-Team + All rights reserved. + http://www.mentalis.org/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Neither the name of the KPD-Team, nor the names of its contributors + may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +using System; +using System.Net; +using System.Net.Sockets; + +namespace Titanium.Web.Proxy.ProxySocket.Authentication +{ + /// + /// Implements a SOCKS authentication scheme. + /// + /// This is an abstract class; it must be inherited. + internal abstract class AuthMethod + { + /// + /// Initializes an AuthMethod instance. + /// + /// The socket connection with the proxy server. + public AuthMethod(Socket server) + { + Server = server; + } + + /// + /// Authenticates the user. + /// + /// Authentication with the proxy server failed. + /// The proxy server uses an invalid protocol. + /// An operating system error occurs while accessing the Socket. + /// The Socket has been closed. + public abstract void Authenticate(); + + /// + /// Authenticates the user asynchronously. + /// + /// The method to call when the authentication is complete. + /// Authentication with the proxy server failed. + /// The proxy server uses an invalid protocol. + /// An operating system error occurs while accessing the Socket. + /// The Socket has been closed. + public abstract void BeginAuthenticate(HandShakeComplete callback); + + /// + /// Gets or sets the socket connection with the proxy server. + /// + /// The socket connection with the proxy server. + protected Socket Server + { + get + { + return _server; + } + set + { + if (value == null) + throw new ArgumentNullException(); + _server = value; + } + } + + /// + /// Gets or sets a byt array that can be used to store data. + /// + /// A byte array to store data. + protected byte[] Buffer + { + get + { + return _buffer; + } + set + { + _buffer = value; + } + } + + /// + /// Gets or sets the number of bytes that have been received from the remote proxy server. + /// + /// An integer that holds the number of bytes that have been received from the remote proxy server. + protected int Received + { + get + { + return _received; + } + set + { + _received = value; + } + } + + // private variables + /// Holds the value of the Buffer property. + private byte[] _buffer; + + /// Holds the value of the Server property. + private Socket _server; + + /// Holds the address of the method to call when the proxy has authenticated the client. + protected HandShakeComplete CallBack; + + /// Holds the value of the Received property. + private int _received; + } +} diff --git a/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthNone.cs b/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthNone.cs new file mode 100644 index 000000000..94df7d57b --- /dev/null +++ b/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthNone.cs @@ -0,0 +1,65 @@ +/* + Copyright © 2002, The KPD-Team + All rights reserved. + http://www.mentalis.org/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Neither the name of the KPD-Team, nor the names of its contributors + may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +using System; +using System.Net.Sockets; + +namespace Titanium.Web.Proxy.ProxySocket.Authentication +{ + /// + /// This class implements the 'No Authentication' scheme. + /// + internal sealed class AuthNone : AuthMethod + { + /// + /// Initializes an AuthNone instance. + /// + /// The socket connection with the proxy server. + public AuthNone(Socket server) : base(server) { } + + /// + /// Authenticates the user. + /// + public override void Authenticate() + { + return; // Do Nothing + } + + /// + /// Authenticates the user asynchronously. + /// + /// The method to call when the authentication is complete. + /// This method immediately calls the callback method. + public override void BeginAuthenticate(HandShakeComplete callback) + { + callback(null); + } + } +} diff --git a/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthUserPass.cs b/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthUserPass.cs new file mode 100644 index 000000000..fed804d21 --- /dev/null +++ b/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthUserPass.cs @@ -0,0 +1,204 @@ +/* + Copyright © 2002, The KPD-Team + All rights reserved. + http://www.mentalis.org/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Neither the name of the KPD-Team, nor the names of its contributors + may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +using System; +using System.Net.Sockets; +using System.Text; + +namespace Titanium.Web.Proxy.ProxySocket.Authentication +{ + /// + /// This class implements the 'username/password authentication' scheme. + /// + internal sealed class AuthUserPass : AuthMethod + { + /// + /// Initializes a new AuthUserPass instance. + /// + /// The socket connection with the proxy server. + /// The username to use. + /// The password to use. + /// user -or- pass is null. + public AuthUserPass(Socket server, string user, string pass) : base(server) + { + Username = user; + Password = pass; + } + + /// + /// Creates an array of bytes that has to be sent if the user wants to authenticate with the username/password authentication scheme. + /// + /// An array of bytes that has to be sent if the user wants to authenticate with the username/password authentication scheme. + private byte[] GetAuthenticationBytes() + { + byte[] buffer = new byte[3 + Username.Length + Password.Length]; + buffer[0] = 1; + buffer[1] = (byte)Username.Length; + Array.Copy(Encoding.ASCII.GetBytes(Username), 0, buffer, 2, Username.Length); + buffer[Username.Length + 2] = (byte)Password.Length; + Array.Copy(Encoding.ASCII.GetBytes(Password), 0, buffer, Username.Length + 3, Password.Length); + return buffer; + } + + private int GetAuthenticationLength() + { + return 3 + Username.Length + Password.Length; + } + + /// + /// Starts the authentication process. + /// + public override void Authenticate() + { + if (Server.Send(GetAuthenticationBytes()) < GetAuthenticationLength()) + { + throw new SocketException(10054); + } + + ; + byte[] buffer = new byte[2]; + int received = 0; + while (received != 2) + { + int recv = Server.Receive(buffer, received, 2 - received, SocketFlags.None); + if (recv == 0) + throw new SocketException(10054); + received += recv; + } + + if (buffer[1] != 0) + { + Server.Close(); + throw new ProxyException("Username/password combination rejected."); + } + + return; + } + + /// + /// Starts the asynchronous authentication process. + /// + /// The method to call when the authentication is complete. + public override void BeginAuthenticate(HandShakeComplete callback) + { + CallBack = callback; + Server.BeginSend(GetAuthenticationBytes(), 0, GetAuthenticationLength(), SocketFlags.None, + new AsyncCallback(this.OnSent), Server); + return; + } + + /// + /// Called when the authentication bytes have been sent. + /// + /// Stores state information for this asynchronous operation as well as any user-defined data. + private void OnSent(IAsyncResult ar) + { + try + { + if (Server.EndSend(ar) < GetAuthenticationLength()) + throw new SocketException(10054); + Buffer = new byte[2]; + Server.BeginReceive(Buffer, 0, 2, SocketFlags.None, new AsyncCallback(this.OnReceive), Server); + } + catch (Exception e) + { + CallBack(e); + } + } + + /// + /// Called when the socket received an authentication reply. + /// + /// Stores state information for this asynchronous operation as well as any user-defined data. + private void OnReceive(IAsyncResult ar) + { + try + { + int recv = Server.EndReceive(ar); + if (recv <= 0) + throw new SocketException(10054); + Received += recv; + if (Received == Buffer.Length) + if (Buffer[1] == 0) + CallBack(null); + else + throw new ProxyException("Username/password combination not accepted."); + else + Server.BeginReceive(Buffer, Received, Buffer.Length - Received, SocketFlags.None, + new AsyncCallback(this.OnReceive), Server); + } + catch (Exception e) + { + CallBack(e); + } + } + + /// + /// Gets or sets the username to use when authenticating with the proxy server. + /// + /// The username to use when authenticating with the proxy server. + /// The specified value is null. + private string Username + { + get + { + return _username; + } + set + { + _username = value ?? throw new ArgumentNullException(); + } + } + + /// + /// Gets or sets the password to use when authenticating with the proxy server. + /// + /// The password to use when authenticating with the proxy server. + /// The specified value is null. + private string Password + { + get + { + return _password; + } + set + { + _password = value ?? throw new ArgumentNullException(); + } + } + + // private variables + /// Holds the value of the Username property. + private string _username; + + /// Holds the value of the Password property. + private string _password; + } +} diff --git a/src/Titanium.Web.Proxy/ProxySocket/HttpsHandler.cs b/src/Titanium.Web.Proxy/ProxySocket/HttpsHandler.cs new file mode 100644 index 000000000..3ed82a0f1 --- /dev/null +++ b/src/Titanium.Web.Proxy/ProxySocket/HttpsHandler.cs @@ -0,0 +1,355 @@ +/* + Copyright © 2002, The KPD-Team + All rights reserved. + http://www.mentalis.org/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Neither the name of the KPD-Team, nor the names of its contributors + may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +using System; +using System.Net; +using System.Net.Sockets; +using System.Text; + +namespace Titanium.Web.Proxy.ProxySocket +{ + /// + /// Implements the HTTPS (CONNECT) protocol. + /// + internal sealed class HttpsHandler : SocksHandler + { + /// + /// Initializes a new HttpsHandler instance. + /// + /// The socket connection with the proxy server. + /// server is null. + public HttpsHandler(Socket server) : this(server, "") { } + + /// + /// Initializes a new HttpsHandler instance. + /// + /// The socket connection with the proxy server. + /// The username to use. + /// server -or- user is null. + public HttpsHandler(Socket server, string user) : this(server, user, "") { } + + /// + /// Initializes a new HttpsHandler instance. + /// + /// The socket connection with the proxy server. + /// The username to use. + /// The password to use. + /// server -or- user -or- pass is null. + public HttpsHandler(Socket server, string user, string pass) : base(server, user) + { + Password = pass; + } + + /// + /// Creates an array of bytes that has to be sent when the user wants to connect to a specific IPEndPoint. + /// + /// An array of bytes that has to be sent when the user wants to connect to a specific IPEndPoint. + private byte[] GetConnectBytes(string host, int port) + { + StringBuilder sb = new StringBuilder(); + sb.AppendLine(string.Format("CONNECT {0}:{1} HTTP/1.1", host, port)); + sb.AppendLine(string.Format("Host: {0}:{1}", host, port)); + if (!string.IsNullOrEmpty(Username)) + { + string auth = + Convert.ToBase64String(Encoding.ASCII.GetBytes(String.Format("{0}:{1}", Username, Password))); + sb.AppendLine(string.Format("Proxy-Authorization: Basic {0}", auth)); + } + + sb.AppendLine(); + byte[] buffer = Encoding.ASCII.GetBytes(sb.ToString()); + return buffer; + } + + /// + /// Verifies that proxy server successfully connected to requested host + /// + /// Input data array + private void VerifyConnectHeader(byte[] buffer) + { + string header = Encoding.ASCII.GetString(buffer); + if ((!header.StartsWith("HTTP/1.1 ", StringComparison.OrdinalIgnoreCase) && + !header.StartsWith("HTTP/1.0 ", StringComparison.OrdinalIgnoreCase)) || !header.EndsWith(" ")) + throw new ProtocolViolationException(); + string code = header.Substring(9, 3); + if (code != "200") + throw new ProxyException("Invalid HTTP status. Code: " + code); + } + + /// + /// Starts negotiating with the SOCKS server. + /// + /// The IPEndPoint to connect to. + /// remoteEP is null. + /// The proxy rejected the request. + /// An operating system error occurs while accessing the Socket. + /// The Socket has been closed. + /// The proxy server uses an invalid protocol. + public override void Negotiate(IPEndPoint remoteEP) + { + if (remoteEP == null) + throw new ArgumentNullException(); + Negotiate(remoteEP.Address.ToString(), remoteEP.Port); + } + + /// + /// Starts negotiating with the SOCKS server. + /// + /// The host to connect to. + /// The port to connect to. + /// host is null. + /// port is invalid. + /// The proxy rejected the request. + /// An operating system error occurs while accessing the Socket. + /// The Socket has been closed. + /// The proxy server uses an invalid protocol. + public override void Negotiate(string host, int port) + { + if (host == null) + throw new ArgumentNullException(); + if (port <= 0 || port > 65535 || host.Length > 255) + throw new ArgumentException(); + byte[] buffer = GetConnectBytes(host, port); + if (Server.Send(buffer, 0, buffer.Length, SocketFlags.None) < buffer.Length) + { + throw new SocketException(10054); + } + + buffer = ReadBytes(13); + VerifyConnectHeader(buffer); + + // Read bytes 1 by 1 until we reach "\r\n\r\n" + int receivedNewlineChars = 0; + buffer = new byte[1]; + while (receivedNewlineChars < 4) + { + int recv = Server.Receive(buffer, 0, 1, SocketFlags.None); + if (recv == 0) + { + throw new SocketException(10054); + } + + byte b = buffer[0]; + if (b == (receivedNewlineChars % 2 == 0 ? '\r' : '\n')) + receivedNewlineChars++; + else + receivedNewlineChars = b == '\r' ? 1 : 0; + } + } + + /// + /// Starts negotiating asynchronously with the HTTPS server. + /// + /// An IPEndPoint that represents the remote device. + /// The method to call when the negotiation is complete. + /// The IPEndPoint of the HTTPS proxy server. + /// An IAsyncProxyResult that references the asynchronous connection. + public override IAsyncProxyResult BeginNegotiate(IPEndPoint remoteEP, HandShakeComplete callback, + IPEndPoint proxyEndPoint) + { + return BeginNegotiate(remoteEP.Address.ToString(), remoteEP.Port, callback, proxyEndPoint); + } + + /// + /// Starts negotiating asynchronously with the HTTPS server. + /// + /// The host to connect to. + /// The port to connect to. + /// The method to call when the negotiation is complete. + /// The IPEndPoint of the HTTPS proxy server. + /// An IAsyncProxyResult that references the asynchronous connection. + public override IAsyncProxyResult BeginNegotiate(string host, int port, HandShakeComplete callback, + IPEndPoint proxyEndPoint) + { + ProtocolComplete = callback; + Buffer = GetConnectBytes(host, port); + Server.BeginConnect(proxyEndPoint, new AsyncCallback(this.OnConnect), Server); + AsyncResult = new IAsyncProxyResult(); + return AsyncResult; + } + + /// + /// Called when the socket is connected to the remote server. + /// + /// Stores state information for this asynchronous operation as well as any user-defined data. + private void OnConnect(IAsyncResult ar) + { + try + { + Server.EndConnect(ar); + } + catch (Exception e) + { + ProtocolComplete(e); + return; + } + + try + { + Server.BeginSend(Buffer, 0, Buffer.Length, SocketFlags.None, new AsyncCallback(this.OnConnectSent), + null); + } + catch (Exception e) + { + ProtocolComplete(e); + } + } + + /// + /// Called when the connect request bytes have been sent. + /// + /// Stores state information for this asynchronous operation as well as any user-defined data. + private void OnConnectSent(IAsyncResult ar) + { + try + { + HandleEndSend(ar, Buffer.Length); + Buffer = new byte[13]; + Received = 0; + Server.BeginReceive(Buffer, 0, 13, SocketFlags.None, new AsyncCallback(this.OnConnectReceive), Server); + } + catch (Exception e) + { + ProtocolComplete(e); + } + } + + /// + /// Called when an connect reply has been received. + /// + /// Stores state information for this asynchronous operation as well as any user-defined data. + private void OnConnectReceive(IAsyncResult ar) + { + try + { + HandleEndReceive(ar); + } + catch (Exception e) + { + ProtocolComplete(e); + return; + } + + try + { + if (Received < 13) + { + Server.BeginReceive(Buffer, Received, 13 - Received, SocketFlags.None, + new AsyncCallback(this.OnConnectReceive), Server); + } + else + { + VerifyConnectHeader(Buffer); + ReadUntilHeadersEnd(true); + } + } + catch (Exception e) + { + ProtocolComplete(e); + } + } + + /// + /// Reads socket buffer byte by byte until we reach "\r\n\r\n". + /// + /// + private void ReadUntilHeadersEnd(bool readFirstByte) + { + while (Server.Available > 0 && _receivedNewlineChars < 4) + { + if (!readFirstByte) + readFirstByte = false; + else + { + int recv = Server.Receive(Buffer, 0, 1, SocketFlags.None); + if (recv == 0) + throw new SocketException(10054); + } + + if (Buffer[0] == (_receivedNewlineChars % 2 == 0 ? '\r' : '\n')) + _receivedNewlineChars++; + else + _receivedNewlineChars = Buffer[0] == '\r' ? 1 : 0; + } + + if (_receivedNewlineChars == 4) + { + ProtocolComplete(null); + } + else + { + Server.BeginReceive(Buffer, 0, 1, SocketFlags.None, new AsyncCallback(this.OnEndHeadersReceive), + Server); + } + } + + // I think we should never reach this function in practice + // But let's define it just in case + /// + /// Called when additional headers have been received. + /// + /// Stores state information for this asynchronous operation as well as any user-defined data. + private void OnEndHeadersReceive(IAsyncResult ar) + { + try + { + HandleEndReceive(ar); + ReadUntilHeadersEnd(false); + } + catch (Exception e) + { + ProtocolComplete(e); + } + } + + /// + /// Gets or sets the password to use when authenticating with the HTTPS server. + /// + /// The password to use when authenticating with the HTTPS server. + private string Password + { + get + { + return _password; + } + set + { + _password = value ?? throw new ArgumentNullException(); + } + } + + // private variables + /// Holds the value of the Password property. + private string _password; + + /// Holds the count of newline characters received. + private int _receivedNewlineChars; + } +} diff --git a/src/Titanium.Web.Proxy/ProxySocket/IAsyncProxyResult.cs b/src/Titanium.Web.Proxy/ProxySocket/IAsyncProxyResult.cs new file mode 100644 index 000000000..5d95ba3cc --- /dev/null +++ b/src/Titanium.Web.Proxy/ProxySocket/IAsyncProxyResult.cs @@ -0,0 +1,116 @@ +/* + Copyright © 2002, The KPD-Team + All rights reserved. + http://www.mentalis.org/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Neither the name of the KPD-Team, nor the names of its contributors + may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +using System; +using System.Threading; + +namespace Titanium.Web.Proxy.ProxySocket +{ + /// + /// A class that implements the IAsyncResult interface. Objects from this class are returned by the BeginConnect method of the ProxySocket class. + /// + internal class IAsyncProxyResult : IAsyncResult + { + /// Initializes the internal variables of this object + /// An object that contains state information for this request. + internal IAsyncProxyResult(object stateObject = null) + { + _stateObject = stateObject; + _completed = false; + if (_waitHandle != null) + _waitHandle.Reset(); + + } + + /// Initializes the internal variables of this object + internal void Reset() + { + _stateObject = null; + _completed = true; + if (_waitHandle != null) + _waitHandle.Set(); + } + + /// Gets a value that indicates whether the server has completed processing the call. It is illegal for the server to use any client supplied resources outside of the agreed upon sharing semantics after it sets the IsCompleted property to "true". Thus, it is safe for the client to destroy the resources after IsCompleted property returns "true". + /// A boolean that indicates whether the server has completed processing the call. + public bool IsCompleted + { + get + { + return _completed; + } + } + + /// Gets a value that indicates whether the BeginXXXX call has been completed synchronously. If this is detected in the AsyncCallback delegate, it is probable that the thread that called BeginInvoke is the current thread. + /// Returns false. + public bool CompletedSynchronously + { + get + { + return false; + } + } + + /// Gets an object that was passed as the state parameter of the BeginXXXX method call. + /// The object that was passed as the state parameter of the BeginXXXX method call. + public object AsyncState + { + get + { + return _stateObject; + } + } + + /// + /// The AsyncWaitHandle property returns the WaitHandle that can use to perform a WaitHandle.WaitOne or WaitAny or WaitAll. The object which implements IAsyncResult need not derive from the System.WaitHandle classes directly. The WaitHandle wraps its underlying synchronization primitive and should be signaled after the call is completed. This enables the client to wait for the call to complete instead polling. The Runtime supplies a number of waitable objects that mirror Win32 synchronization primitives e.g. ManualResetEvent, AutoResetEvent and Mutex. + /// WaitHandle supplies methods that support waiting for such synchronization objects to become signaled with "any" or "all" semantics i.e. WaitHandle.WaitOne, WaitAny and WaitAll. Such methods are context aware to avoid deadlocks. The AsyncWaitHandle can be allocated eagerly or on demand. It is the choice of the IAsyncResult implementer. + /// + /// The WaitHandle associated with this asynchronous result. + public WaitHandle AsyncWaitHandle + { + get + { + if (_waitHandle == null) + _waitHandle = new ManualResetEvent(false); + return _waitHandle; + } + } + + // private variables + /// Used internally to represent the state of the asynchronous request + private bool _completed; + + /// Holds the value of the StateObject property. + private object _stateObject; + + /// Holds the value of the WaitHandle property. + private ManualResetEvent _waitHandle; + } +} diff --git a/src/Titanium.Web.Proxy/ProxySocket/ProxyException.cs b/src/Titanium.Web.Proxy/ProxySocket/ProxyException.cs new file mode 100644 index 000000000..14d6798d9 --- /dev/null +++ b/src/Titanium.Web.Proxy/ProxySocket/ProxyException.cs @@ -0,0 +1,90 @@ +/* + Copyright © 2002, The KPD-Team + All rights reserved. + http://www.mentalis.org/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Neither the name of the KPD-Team, nor the names of its contributors + may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +using System; + +namespace Titanium.Web.Proxy.ProxySocket +{ + /// + /// The exception that is thrown when a proxy error occurs. + /// + [Serializable] + internal class ProxyException : Exception + { + /// + /// Initializes a new instance of the ProxyException class. + /// + public ProxyException() : this("An error occured while talking to the proxy server.") { } + + /// + /// Initializes a new instance of the ProxyException class. + /// + /// The message that describes the error. + public ProxyException(string message) : base(message) { } + + /// + /// Initializes a new instance of the ProxyException class. + /// + /// The error number returned by a SOCKS5 server. + public ProxyException(int socks5Error) : this(ProxyException.Socks5ToString(socks5Error)) { } + + /// + /// Converts a SOCKS5 error number to a human readable string. + /// + /// The error number returned by a SOCKS5 server. + /// A string representation of the specified SOCKS5 error number. + public static string Socks5ToString(int socks5Error) + { + switch (socks5Error) + { + case 0: + return "Connection succeeded."; + case 1: + return "General SOCKS server failure."; + case 2: + return "Connection not allowed by ruleset."; + case 3: + return "Network unreachable."; + case 4: + return "Host unreachable."; + case 5: + return "Connection refused."; + case 6: + return "TTL expired."; + case 7: + return "Command not supported."; + case 8: + return "Address type not supported."; + default: + return "Unspecified SOCKS error."; + } + } + } +} diff --git a/src/Titanium.Web.Proxy/ProxySocket/ProxySocket.cs b/src/Titanium.Web.Proxy/ProxySocket/ProxySocket.cs new file mode 100644 index 000000000..30b6f0987 --- /dev/null +++ b/src/Titanium.Web.Proxy/ProxySocket/ProxySocket.cs @@ -0,0 +1,529 @@ +/* + Copyright © 2002, The KPD-Team + All rights reserved. + http://www.mentalis.org/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Neither the name of the KPD-Team, nor the names of its contributors + may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +using System; +using System.Net; +using System.Net.Sockets; + +// Implements a number of classes to allow Sockets to connect trough a firewall. +namespace Titanium.Web.Proxy.ProxySocket +{ + /// + /// Specifies the type of proxy servers that an instance of the ProxySocket class can use. + /// + internal enum ProxyTypes + { + /// No proxy server; the ProxySocket object behaves exactly like an ordinary Socket object. + None, + + /// A HTTPS (CONNECT) proxy server. + Https, + + /// A SOCKS4[A] proxy server. + Socks4, + + /// A SOCKS5 proxy server. + Socks5 + } + + /// + /// Implements a Socket class that can connect trough a SOCKS proxy server. + /// + /// This class implements SOCKS4[A] and SOCKS5.
It does not, however, implement the BIND commands, so you cannot .
+ internal class ProxySocket : Socket + { + /// + /// Initializes a new instance of the ProxySocket class. + /// + /// One of the AddressFamily values. + /// One of the SocketType values. + /// One of the ProtocolType values. + /// The combination of addressFamily, socketType, and protocolType results in an invalid socket. + public ProxySocket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType) : this( + addressFamily, socketType, protocolType, "") + { + } + + /// + /// Initializes a new instance of the ProxySocket class. + /// + /// One of the AddressFamily values. + /// One of the SocketType values. + /// One of the ProtocolType values. + /// The username to use when authenticating with the proxy server. + /// The combination of addressFamily, socketType, and protocolType results in an invalid socket. + /// proxyUsername is null. + public ProxySocket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType, + string proxyUsername) : this(addressFamily, socketType, protocolType, proxyUsername, "") + { + } + + /// + /// Initializes a new instance of the ProxySocket class. + /// + /// One of the AddressFamily values. + /// One of the SocketType values. + /// One of the ProtocolType values. + /// The username to use when authenticating with the proxy server. + /// The password to use when authenticating with the proxy server. + /// The combination of addressFamily, socketType, and protocolType results in an invalid socket. + /// proxyUsername -or- proxyPassword is null. + public ProxySocket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType, + string proxyUsername, string proxyPassword) : base(addressFamily, socketType, protocolType) + { + ProxyUser = proxyUsername; + ProxyPass = proxyPassword; + ToThrow = new InvalidOperationException(); + } + + /// + /// Establishes a connection to a remote device. + /// + /// An EndPoint that represents the remote device. + /// The remoteEP parameter is a null reference (Nothing in Visual Basic). + /// An operating system error occurs while accessing the Socket. + /// The Socket has been closed. + /// An error occurred while talking to the proxy server. + public new void Connect(EndPoint remoteEP) + { + if (remoteEP == null) + throw new ArgumentNullException(" cannot be null."); + if (this.ProtocolType != ProtocolType.Tcp || ProxyType == ProxyTypes.None || ProxyEndPoint == null) + base.Connect(remoteEP); + else + { + base.Connect(ProxyEndPoint); + if (ProxyType == ProxyTypes.Https) + (new HttpsHandler(this, ProxyUser, ProxyPass)).Negotiate((IPEndPoint)remoteEP); + else if (ProxyType == ProxyTypes.Socks4) + (new Socks4Handler(this, ProxyUser)).Negotiate((IPEndPoint)remoteEP); + else if (ProxyType == ProxyTypes.Socks5) + (new Socks5Handler(this, ProxyUser, ProxyPass)).Negotiate((IPEndPoint)remoteEP); + } + } + + /// + /// Establishes a connection to a remote device. + /// + /// The remote host to connect to. + /// The remote port to connect to. + /// The host parameter is a null reference (Nothing in Visual Basic). + /// The port parameter is invalid. + /// An operating system error occurs while accessing the Socket. + /// The Socket has been closed. + /// An error occurred while talking to the proxy server. + /// If you use this method with a SOCKS4 server, it will let the server resolve the hostname. Not all SOCKS4 servers support this 'remote DNS' though. + public new void Connect(string host, int port) + { + if (host == null) + throw new ArgumentNullException(" cannot be null."); + if (port <= 0 || port > 65535) + throw new ArgumentException("Invalid port."); + if (this.ProtocolType != ProtocolType.Tcp || ProxyType == ProxyTypes.None || ProxyEndPoint == null) + base.Connect(new IPEndPoint(Dns.GetHostEntry(host).AddressList[0], port)); + else + { + base.Connect(ProxyEndPoint); + if (ProxyType == ProxyTypes.Https) + (new HttpsHandler(this, ProxyUser, ProxyPass)).Negotiate(host, port); + else if (ProxyType == ProxyTypes.Socks4) + (new Socks4Handler(this, ProxyUser)).Negotiate(host, port); + else if (ProxyType == ProxyTypes.Socks5) + (new Socks5Handler(this, ProxyUser, ProxyPass)).Negotiate(host, port); + } + } + + /// + /// Begins an asynchronous request for a connection to a network device. + /// + /// An EndPoint address that represents the remote device. + /// An EndPoint port that represents the remote device. + /// The AsyncCallback delegate. + /// An object that contains state information for this request. + /// An IAsyncResult that references the asynchronous connection. + /// The remoteEP parameter is a null reference (Nothing in Visual Basic). + /// An operating system error occurs while creating the Socket. + /// The Socket has been closed. + public new IAsyncResult BeginConnect(IPAddress address, int port, AsyncCallback callback, object state) + { + var remoteEP = new IPEndPoint(address, port); + return BeginConnect(remoteEP, callback, state); + } + + /// + /// Begins an asynchronous request for a connection to a network device. + /// + /// An EndPoint that represents the remote device. + /// The AsyncCallback delegate. + /// An object that contains state information for this request. + /// An IAsyncResult that references the asynchronous connection. + /// The remoteEP parameter is a null reference (Nothing in Visual Basic). + /// An operating system error occurs while creating the Socket. + /// The Socket has been closed. + public new IAsyncResult BeginConnect(EndPoint remoteEP, AsyncCallback callback, object state) + { + if (remoteEP == null) + throw new ArgumentNullException(); + if (this.ProtocolType != ProtocolType.Tcp || ProxyType == ProxyTypes.None || ProxyEndPoint == null) + { + return base.BeginConnect(remoteEP, callback, state); + } + else + { + CallBack = callback; + if (ProxyType == ProxyTypes.Https) + { + AsyncResult = (new HttpsHandler(this, ProxyUser, ProxyPass)).BeginNegotiate((IPEndPoint)remoteEP, + new HandShakeComplete(this.OnHandShakeComplete), ProxyEndPoint); + return AsyncResult; + } + else if (ProxyType == ProxyTypes.Socks4) + { + AsyncResult = (new Socks4Handler(this, ProxyUser)).BeginNegotiate((IPEndPoint)remoteEP, + new HandShakeComplete(this.OnHandShakeComplete), ProxyEndPoint); + return AsyncResult; + } + else if (ProxyType == ProxyTypes.Socks5) + { + AsyncResult = (new Socks5Handler(this, ProxyUser, ProxyPass)).BeginNegotiate((IPEndPoint)remoteEP, + new HandShakeComplete(this.OnHandShakeComplete), ProxyEndPoint); + return AsyncResult; + } + + return null; + } + } + + /// + /// Begins an asynchronous request for a connection to a network device. + /// + /// The host to connect to. + /// The port on the remote host to connect to. + /// The AsyncCallback delegate. + /// An object that contains state information for this request. + /// An IAsyncResult that references the asynchronous connection. + /// The host parameter is a null reference (Nothing in Visual Basic). + /// The port parameter is invalid. + /// An operating system error occurs while creating the Socket. + /// The Socket has been closed. + public new IAsyncResult BeginConnect(string host, int port, AsyncCallback callback, object state) + { + if (host == null) + throw new ArgumentNullException(); + if (port <= 0 || port > 65535) + throw new ArgumentException(); + CallBack = callback; + if (this.ProtocolType != ProtocolType.Tcp || ProxyType == ProxyTypes.None || ProxyEndPoint == null) + { + RemotePort = port; + AsyncResult = BeginDns(host, new HandShakeComplete(this.OnHandShakeComplete)); + return AsyncResult; + } + else + { + if (ProxyType == ProxyTypes.Https) + { + AsyncResult = (new HttpsHandler(this, ProxyUser, ProxyPass)).BeginNegotiate(host, port, + new HandShakeComplete(this.OnHandShakeComplete), ProxyEndPoint); + return AsyncResult; + } + else if (ProxyType == ProxyTypes.Socks4) + { + AsyncResult = (new Socks4Handler(this, ProxyUser)).BeginNegotiate(host, port, + new HandShakeComplete(this.OnHandShakeComplete), ProxyEndPoint); + return AsyncResult; + } + else if (ProxyType == ProxyTypes.Socks5) + { + AsyncResult = (new Socks5Handler(this, ProxyUser, ProxyPass)).BeginNegotiate(host, port, + new HandShakeComplete(this.OnHandShakeComplete), ProxyEndPoint); + return AsyncResult; + } + + return null; + } + } + + /// + /// Ends a pending asynchronous connection request. + /// + /// Stores state information for this asynchronous operation as well as any user-defined data. + /// The asyncResult parameter is a null reference (Nothing in Visual Basic). + /// The asyncResult parameter was not returned by a call to the BeginConnect method. + /// An operating system error occurs while accessing the Socket. + /// The Socket has been closed. + /// EndConnect was previously called for the asynchronous connection. + /// The proxy server refused the connection. + public new void EndConnect(IAsyncResult asyncResult) + { + if (asyncResult == null) + throw new ArgumentNullException(); + // In case we called Socket.BeginConnect() directly + if (!(asyncResult is IAsyncProxyResult)) + { + base.EndConnect(asyncResult); + return; + } + + if (!asyncResult.IsCompleted) + asyncResult.AsyncWaitHandle.WaitOne(); + if (ToThrow != null) + throw ToThrow; + return; + } + + /// + /// Begins an asynchronous request to resolve a DNS host name or IP address in dotted-quad notation to an IPAddress instance. + /// + /// The host to resolve. + /// The method to call when the hostname has been resolved. + /// An IAsyncResult instance that references the asynchronous request. + /// There was an error while trying to resolve the host. + internal IAsyncProxyResult BeginDns(string host, HandShakeComplete callback) + { + try + { + Dns.BeginGetHostEntry(host, new AsyncCallback(this.OnResolved), this); + return new IAsyncProxyResult(); + } + catch + { + throw new SocketException(); + } + } + + /// + /// Called when the specified hostname has been resolved. + /// + /// The result of the asynchronous operation. + private void OnResolved(IAsyncResult asyncResult) + { + try + { + IPHostEntry dns = Dns.EndGetHostEntry(asyncResult); + base.BeginConnect(new IPEndPoint(dns.AddressList[0], RemotePort), new AsyncCallback(this.OnConnect), + State); + } + catch (Exception e) + { + OnHandShakeComplete(e); + } + } + + /// + /// Called when the Socket is connected to the remote host. + /// + /// The result of the asynchronous operation. + private void OnConnect(IAsyncResult asyncResult) + { + try + { + base.EndConnect(asyncResult); + OnHandShakeComplete(null); + } + catch (Exception e) + { + OnHandShakeComplete(e); + } + } + + /// + /// Called when the Socket has finished talking to the proxy server and is ready to relay data. + /// + /// The error to throw when the EndConnect method is called. + private void OnHandShakeComplete(Exception error) + { + if (error != null) + this.Close(); + ToThrow = error; + AsyncResult.Reset(); + if (CallBack != null) + CallBack(AsyncResult); + } + + /// + /// Gets or sets the EndPoint of the proxy server. + /// + /// An IPEndPoint object that holds the IP address and the port of the proxy server. + public IPEndPoint ProxyEndPoint + { + get + { + return _proxyEndPoint; + } + set + { + _proxyEndPoint = value; + } + } + + /// + /// Gets or sets the type of proxy server to use. + /// + /// One of the ProxyTypes values. + public ProxyTypes ProxyType + { + get + { + return _proxyType; + } + set + { + _proxyType = value; + } + } + + /// + /// Gets or sets a user-defined object. + /// + /// The user-defined object. + private object State + { + get + { + return _state; + } + set + { + _state = value; + } + } + + /// + /// Gets or sets the username to use when authenticating with the proxy. + /// + /// A string that holds the username that's used when authenticating with the proxy. + /// The specified value is null. + public string? ProxyUser + { + get + { + return _proxyUser; + } + set + { + _proxyUser = value ?? throw new ArgumentNullException(); + } + } + + /// + /// Gets or sets the password to use when authenticating with the proxy. + /// + /// A string that holds the password that's used when authenticating with the proxy. + /// The specified value is null. + public string? ProxyPass + { + get + { + return _proxyPass; + } + set + { + _proxyPass = value ?? throw new ArgumentNullException(); + } + } + + /// + /// Gets or sets the asynchronous result object. + /// + /// An instance of the IAsyncProxyResult class. + private IAsyncProxyResult AsyncResult + { + get + { + return _asyncResult; + } + set + { + _asyncResult = value; + } + } + + /// + /// Gets or sets the exception to throw when the EndConnect method is called. + /// + /// An instance of the Exception class (or subclasses of Exception). + private Exception ToThrow + { + get + { + return _toThrow; + } + set + { + _toThrow = value; + } + } + + /// + /// Gets or sets the remote port the user wants to connect to. + /// + /// An integer that specifies the port the user wants to connect to. + private int RemotePort + { + get + { + return _remotePort; + } + set + { + _remotePort = value; + } + } + + // private variables + /// Holds the value of the State property. + private object _state; + + /// Holds the value of the ProxyEndPoint property. + private IPEndPoint _proxyEndPoint; + + /// Holds the value of the ProxyType property. + private ProxyTypes _proxyType = ProxyTypes.None; + + /// Holds the value of the ProxyUser property. + private string? _proxyUser; + + /// Holds the value of the ProxyPass property. + private string? _proxyPass; + + /// Holds a pointer to the method that should be called when the Socket is connected to the remote device. + private AsyncCallback CallBack; + + /// Holds the value of the AsyncResult property. + private IAsyncProxyResult _asyncResult; + + /// Holds the value of the ToThrow property. + private Exception _toThrow; + + /// Holds the value of the RemotePort property. + private int _remotePort; + } +} diff --git a/src/Titanium.Web.Proxy/ProxySocket/Socks4Handler.cs b/src/Titanium.Web.Proxy/ProxySocket/Socks4Handler.cs new file mode 100644 index 000000000..f7beb1947 --- /dev/null +++ b/src/Titanium.Web.Proxy/ProxySocket/Socks4Handler.cs @@ -0,0 +1,273 @@ +/* + Copyright © 2002, The KPD-Team + All rights reserved. + http://www.mentalis.org/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Neither the name of the KPD-Team, nor the names of its contributors + may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +using System; +using System.Net; +using System.Net.Sockets; +using System.Text; + +namespace Titanium.Web.Proxy.ProxySocket +{ + /// + /// Implements the SOCKS4[A] protocol. + /// + internal sealed class Socks4Handler : SocksHandler + { + /// + /// Initializes a new instance of the SocksHandler class. + /// + /// The socket connection with the proxy server. + /// The username to use when authenticating with the server. + /// server -or- user is null. + public Socks4Handler(Socket server, string user) : base(server, user) { } + + /// + /// Creates an array of bytes that has to be sent when the user wants to connect to a specific host/port combination. + /// + /// The host to connect to. + /// The port to connect to. + /// An array of bytes that has to be sent when the user wants to connect to a specific host/port combination. + /// Resolving the host name will be done at server side. Do note that some SOCKS4 servers do not implement this functionality. + /// host is null. + /// port is invalid. + private byte[] GetHostPortBytes(string host, int port) + { + if (host == null) + throw new ArgumentNullException(); + if (port <= 0 || port > 65535) + throw new ArgumentException(); + byte[] connect = new byte[10 + Username.Length + host.Length]; + connect[0] = 4; + connect[1] = 1; + Array.Copy(PortToBytes(port), 0, connect, 2, 2); + connect[4] = connect[5] = connect[6] = 0; + connect[7] = 1; + Array.Copy(Encoding.ASCII.GetBytes(Username), 0, connect, 8, Username.Length); + connect[8 + Username.Length] = 0; + Array.Copy(Encoding.ASCII.GetBytes(host), 0, connect, 9 + Username.Length, host.Length); + connect[9 + Username.Length + host.Length] = 0; + return connect; + } + + /// + /// Creates an array of bytes that has to be sent when the user wants to connect to a specific IPEndPoint. + /// + /// The IPEndPoint to connect to. + /// An array of bytes that has to be sent when the user wants to connect to a specific IPEndPoint. + /// remoteEP is null. + private byte[] GetEndPointBytes(IPEndPoint remoteEP) + { + if (remoteEP == null) + throw new ArgumentNullException(); + byte[] connect = new byte[9 + Username.Length]; + connect[0] = 4; + connect[1] = 1; + Array.Copy(PortToBytes(remoteEP.Port), 0, connect, 2, 2); + Array.Copy(remoteEP.Address.GetAddressBytes(), 0, connect, 4, 4); + Array.Copy(Encoding.ASCII.GetBytes(Username), 0, connect, 8, Username.Length); + connect[8 + Username.Length] = 0; + return connect; + } + + /// + /// Starts negotiating with the SOCKS server. + /// + /// The host to connect to. + /// The port to connect to. + /// host is null. + /// port is invalid. + /// The proxy rejected the request. + /// An operating system error occurs while accessing the Socket. + /// The Socket has been closed. + public override void Negotiate(string host, int port) + { + Negotiate(GetHostPortBytes(host, port)); + } + + /// + /// Starts negotiating with the SOCKS server. + /// + /// The IPEndPoint to connect to. + /// remoteEP is null. + /// The proxy rejected the request. + /// An operating system error occurs while accessing the Socket. + /// The Socket has been closed. + public override void Negotiate(IPEndPoint remoteEP) + { + Negotiate(GetEndPointBytes(remoteEP)); + } + + /// + /// Starts negotiating with the SOCKS server. + /// + /// The bytes to send when trying to authenticate. + /// connect is null. + /// connect is too small. + /// The proxy rejected the request. + /// An operating system error occurs while accessing the Socket. + /// The Socket has been closed. + private void Negotiate(byte[] connect) + { + if (connect == null) + throw new ArgumentNullException(); + if (connect.Length < 2) + throw new ArgumentException(); + if (Server.Send(connect) < connect.Length) + throw new SocketException(10054); + byte[] buffer = ReadBytes(8); + if (buffer[1] != 90) + { + Server.Close(); + throw new ProxyException("Negotiation failed."); + } + } + + /// + /// Starts negotiating asynchronously with a SOCKS proxy server. + /// + /// The remote server to connect to. + /// The remote port to connect to. + /// The method to call when the connection has been established. + /// The IPEndPoint of the SOCKS proxy server. + /// An IAsyncProxyResult that references the asynchronous connection. + public override IAsyncProxyResult BeginNegotiate(string host, int port, HandShakeComplete callback, + IPEndPoint proxyEndPoint) + { + ProtocolComplete = callback; + Buffer = GetHostPortBytes(host, port); + Server.BeginConnect(proxyEndPoint, new AsyncCallback(this.OnConnect), Server); + AsyncResult = new IAsyncProxyResult(); + return AsyncResult; + } + + /// + /// Starts negotiating asynchronously with a SOCKS proxy server. + /// + /// An IPEndPoint that represents the remote device. + /// The method to call when the connection has been established. + /// The IPEndPoint of the SOCKS proxy server. + /// An IAsyncProxyResult that references the asynchronous connection. + public override IAsyncProxyResult BeginNegotiate(IPEndPoint remoteEP, HandShakeComplete callback, + IPEndPoint proxyEndPoint) + { + ProtocolComplete = callback; + Buffer = GetEndPointBytes(remoteEP); + Server.BeginConnect(proxyEndPoint, new AsyncCallback(this.OnConnect), Server); + AsyncResult = new IAsyncProxyResult(); + return AsyncResult; + } + + /// + /// Called when the Socket is connected to the remote proxy server. + /// + /// Stores state information for this asynchronous operation as well as any user-defined data. + private void OnConnect(IAsyncResult ar) + { + try + { + Server.EndConnect(ar); + } + catch (Exception e) + { + ProtocolComplete(e); + return; + } + + try + { + Server.BeginSend(Buffer, 0, Buffer.Length, SocketFlags.None, new AsyncCallback(this.OnSent), Server); + } + catch (Exception e) + { + ProtocolComplete(e); + } + } + + /// + /// Called when the Socket has sent the handshake data. + /// + /// Stores state information for this asynchronous operation as well as any user-defined data. + private void OnSent(IAsyncResult ar) + { + try + { + HandleEndSend(ar, Buffer.Length); + } + catch (Exception e) + { + ProtocolComplete(e); + return; + } + + try + { + Buffer = new byte[8]; + Received = 0; + Server.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, new AsyncCallback(this.OnReceive), + Server); + } + catch (Exception e) + { + ProtocolComplete(e); + } + } + + /// + /// Called when the Socket has received a reply from the remote proxy server. + /// + /// Stores state information for this asynchronous operation as well as any user-defined data. + private void OnReceive(IAsyncResult ar) + { + try + { + HandleEndReceive(ar); + if (Received == 8) + { + if (Buffer[1] == 90) + ProtocolComplete(null); + else + { + Server.Close(); + ProtocolComplete(new ProxyException("Negotiation failed.")); + } + } + else + { + Server.BeginReceive(Buffer, Received, Buffer.Length - Received, SocketFlags.None, + new AsyncCallback(this.OnReceive), Server); + } + } + catch (Exception e) + { + ProtocolComplete(e); + } + } + } +} diff --git a/src/Titanium.Web.Proxy/ProxySocket/Socks5Handler.cs b/src/Titanium.Web.Proxy/ProxySocket/Socks5Handler.cs new file mode 100644 index 000000000..2049254ab --- /dev/null +++ b/src/Titanium.Web.Proxy/ProxySocket/Socks5Handler.cs @@ -0,0 +1,534 @@ +/* + Copyright © 2002, The KPD-Team + All rights reserved. + http://www.mentalis.org/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Neither the name of the KPD-Team, nor the names of its contributors + may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +using System; +using System.Net; +using System.Net.Sockets; +using System.Text; +using Titanium.Web.Proxy.ProxySocket.Authentication; + +namespace Titanium.Web.Proxy.ProxySocket +{ + /// + /// Implements the SOCKS5 protocol. + /// + internal sealed class Socks5Handler : SocksHandler + { + /// + /// Initializes a new Socks5Handler instance. + /// + /// The socket connection with the proxy server. + /// server is null. + public Socks5Handler(Socket server) : this(server, "") { } + + /// + /// Initializes a new Socks5Handler instance. + /// + /// The socket connection with the proxy server. + /// The username to use. + /// server -or- user is null. + public Socks5Handler(Socket server, string user) : this(server, user, "") { } + + /// + /// Initializes a new Socks5Handler instance. + /// + /// The socket connection with the proxy server. + /// The username to use. + /// The password to use. + /// server -or- user -or- pass is null. + public Socks5Handler(Socket server, string user, string pass) : base(server, user) + { + Password = pass; + } + + /// + /// Starts the synchronous authentication process. + /// + /// Authentication with the proxy server failed. + /// The proxy server uses an invalid protocol. + /// An operating system error occurs while accessing the Socket. + /// The Socket has been closed. + private void Authenticate() + { + if (Server.Send(new byte[] { 5, 2, 0, 2 }) < 4) + throw new SocketException(10054); + byte[] buffer = ReadBytes(2); + if (buffer[1] == 255) + throw new ProxyException("No authentication method accepted."); + AuthMethod authenticate; + switch (buffer[1]) + { + case 0: + authenticate = new AuthNone(Server); + break; + case 2: + authenticate = new AuthUserPass(Server, Username, Password); + break; + default: + throw new ProtocolViolationException(); + } + + authenticate.Authenticate(); + } + + /// + /// Creates an array of bytes that has to be sent when the user wants to connect to a specific host/port combination. + /// + /// The host to connect to. + /// The port to connect to. + /// An array of bytes that has to be sent when the user wants to connect to a specific host/port combination. + /// host is null. + /// port or host is invalid. + private byte[] GetHostPortBytes(string host, int port) + { + if (host == null) + throw new ArgumentNullException(); + if (port <= 0 || port > 65535 || host.Length > 255) + throw new ArgumentException(); + byte[] connect = new byte[7 + host.Length]; + connect[0] = 5; + connect[1] = 1; + connect[2] = 0; //reserved + connect[3] = 3; + connect[4] = (byte)host.Length; + Array.Copy(Encoding.ASCII.GetBytes(host), 0, connect, 5, host.Length); + Array.Copy(PortToBytes(port), 0, connect, host.Length + 5, 2); + return connect; + } + + /// + /// Creates an array of bytes that has to be sent when the user wants to connect to a specific IPEndPoint. + /// + /// The IPEndPoint to connect to. + /// An array of bytes that has to be sent when the user wants to connect to a specific IPEndPoint. + /// remoteEP is null. + private byte[] GetEndPointBytes(IPEndPoint remoteEP) + { + if (remoteEP == null) + throw new ArgumentNullException(); + byte[] connect = new byte[10]; + connect[0] = 5; + connect[1] = 1; + connect[2] = 0; //reserved + connect[3] = 1; + Array.Copy(remoteEP.Address.GetAddressBytes(), 0, connect, 4, 4); + Array.Copy(PortToBytes(remoteEP.Port), 0, connect, 8, 2); + return connect; + } + + /// + /// Starts negotiating with the SOCKS server. + /// + /// The host to connect to. + /// The port to connect to. + /// host is null. + /// port is invalid. + /// The proxy rejected the request. + /// An operating system error occurs while accessing the Socket. + /// The Socket has been closed. + /// The proxy server uses an invalid protocol. + public override void Negotiate(string host, int port) + { + Negotiate(GetHostPortBytes(host, port)); + } + + /// + /// Starts negotiating with the SOCKS server. + /// + /// The IPEndPoint to connect to. + /// remoteEP is null. + /// The proxy rejected the request. + /// An operating system error occurs while accessing the Socket. + /// The Socket has been closed. + /// The proxy server uses an invalid protocol. + public override void Negotiate(IPEndPoint remoteEP) + { + Negotiate(GetEndPointBytes(remoteEP)); + } + + /// + /// Starts negotiating with the SOCKS server. + /// + /// The bytes to send when trying to authenticate. + /// connect is null. + /// connect is too small. + /// The proxy rejected the request. + /// An operating system error occurs while accessing the Socket. + /// The Socket has been closed. + /// The proxy server uses an invalid protocol. + private void Negotiate(byte[] connect) + { + Authenticate(); + if (Server.Send(connect) < connect.Length) + throw new SocketException(10054); + byte[] buffer = ReadBytes(4); + if (buffer[1] != 0) + { + Server.Close(); + throw new ProxyException(buffer[1]); + } + + switch (buffer[3]) + { + case 1: + buffer = ReadBytes(6); //IPv4 address with port + break; + case 3: + buffer = ReadBytes(1); + buffer = ReadBytes(buffer[0] + 2); //domain name with port + break; + case 4: + buffer = ReadBytes(18); //IPv6 address with port + break; + default: + Server.Close(); + throw new ProtocolViolationException(); + } + } + + /// + /// Starts negotiating asynchronously with the SOCKS server. + /// + /// The host to connect to. + /// The port to connect to. + /// The method to call when the negotiation is complete. + /// The IPEndPoint of the SOCKS proxy server. + /// An IAsyncProxyResult that references the asynchronous connection. + public override IAsyncProxyResult BeginNegotiate(string host, int port, HandShakeComplete callback, + IPEndPoint proxyEndPoint) + { + ProtocolComplete = callback; + HandShake = GetHostPortBytes(host, port); + Server.BeginConnect(proxyEndPoint, new AsyncCallback(this.OnConnect), Server); + AsyncResult = new IAsyncProxyResult(); + return AsyncResult; + } + + /// + /// Starts negotiating asynchronously with the SOCKS server. + /// + /// An IPEndPoint that represents the remote device. + /// The method to call when the negotiation is complete. + /// The IPEndPoint of the SOCKS proxy server. + /// An IAsyncProxyResult that references the asynchronous connection. + public override IAsyncProxyResult BeginNegotiate(IPEndPoint remoteEP, HandShakeComplete callback, + IPEndPoint proxyEndPoint) + { + ProtocolComplete = callback; + HandShake = GetEndPointBytes(remoteEP); + Server.BeginConnect(proxyEndPoint, new AsyncCallback(this.OnConnect), Server); + AsyncResult = new IAsyncProxyResult(); + return AsyncResult; + } + + /// + /// Called when the socket is connected to the remote server. + /// + /// Stores state information for this asynchronous operation as well as any user-defined data. + private void OnConnect(IAsyncResult ar) + { + try + { + Server.EndConnect(ar); + } + catch (Exception e) + { + ProtocolComplete(e); + return; + } + + try + { + Server.BeginSend(new byte[] { 5, 2, 0, 2 }, 0, 4, SocketFlags.None, new AsyncCallback(this.OnAuthSent), + Server); + } + catch (Exception e) + { + ProtocolComplete(e); + } + } + + /// + /// Called when the authentication bytes have been sent. + /// + /// Stores state information for this asynchronous operation as well as any user-defined data. + private void OnAuthSent(IAsyncResult ar) + { + try + { + HandleEndSend(ar, 4); + } + catch (Exception e) + { + ProtocolComplete(e); + return; + } + + try + { + Buffer = new byte[1024]; + Received = 0; + Server.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, new AsyncCallback(this.OnAuthReceive), + Server); + } + catch (Exception e) + { + ProtocolComplete(e); + } + } + + /// + /// Called when an authentication reply has been received. + /// + /// Stores state information for this asynchronous operation as well as any user-defined data. + private void OnAuthReceive(IAsyncResult ar) + { + try + { + HandleEndReceive(ar); + } + catch (Exception e) + { + ProtocolComplete(e); + return; + } + + try + { + if (Received < 2) + { + Server.BeginReceive(Buffer, Received, Buffer.Length - Received, SocketFlags.None, + new AsyncCallback(this.OnAuthReceive), Server); + } + else + { + AuthMethod authenticate; + switch (Buffer[1]) + { + case 0: + authenticate = new AuthNone(Server); + break; + case 2: + authenticate = new AuthUserPass(Server, Username, Password); + break; + default: + ProtocolComplete(new SocketException()); + return; + } + + authenticate.BeginAuthenticate(new HandShakeComplete(this.OnAuthenticated)); + } + } + catch (Exception e) + { + ProtocolComplete(e); + } + } + + /// + /// Called when the socket has been successfully authenticated with the server. + /// + /// The exception that has occurred while authenticating, or null if no error occurred. + private void OnAuthenticated(Exception e) + { + if (e != null) + { + ProtocolComplete(e); + return; + } + + try + { + Server.BeginSend(HandShake, 0, HandShake.Length, SocketFlags.None, new AsyncCallback(this.OnSent), + Server); + } + catch (Exception ex) + { + ProtocolComplete(ex); + } + } + + /// + /// Called when the connection request has been sent. + /// + /// Stores state information for this asynchronous operation as well as any user-defined data. + private void OnSent(IAsyncResult ar) + { + try + { + HandleEndSend(ar, HandShake.Length); + } + catch (Exception e) + { + ProtocolComplete(e); + return; + } + + try + { + Buffer = new byte[5]; + Received = 0; + Server.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, new AsyncCallback(this.OnReceive), + Server); + } + catch (Exception e) + { + ProtocolComplete(e); + } + } + + /// + /// Called when a connection reply has been received. + /// + /// Stores state information for this asynchronous operation as well as any user-defined data. + private void OnReceive(IAsyncResult ar) + { + try + { + HandleEndReceive(ar); + } + catch (Exception e) + { + ProtocolComplete(e); + return; + } + + try + { + if (Received == Buffer.Length) + ProcessReply(Buffer); + else + Server.BeginReceive(Buffer, Received, Buffer.Length - Received, SocketFlags.None, + new AsyncCallback(this.OnReceive), Server); + } + catch (Exception e) + { + ProtocolComplete(e); + } + } + + /// + /// Processes the received reply. + /// + /// The received reply + /// The received reply is invalid. + private void ProcessReply(byte[] buffer) + { + switch (buffer[3]) + { + case 1: + Buffer = new byte[5]; //IPv4 address with port - 1 byte + break; + case 3: + Buffer = new byte[buffer[4] + 2]; //domain name with port + break; + case 4: + buffer = new byte[17]; //IPv6 address with port - 1 byte + break; + default: + throw new ProtocolViolationException(); + } + + Received = 0; + Server.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, new AsyncCallback(this.OnReadLast), Server); + } + + /// + /// Called when the last bytes are read from the socket. + /// + /// Stores state information for this asynchronous operation as well as any user-defined data. + private void OnReadLast(IAsyncResult ar) + { + try + { + HandleEndReceive(ar); + } + catch (Exception e) + { + ProtocolComplete(e); + return; + } + + try + { + if (Received == Buffer.Length) + ProtocolComplete(null); + else + Server.BeginReceive(Buffer, Received, Buffer.Length - Received, SocketFlags.None, + new AsyncCallback(this.OnReadLast), Server); + } + catch (Exception e) + { + ProtocolComplete(e); + } + } + + /// + /// Gets or sets the password to use when authenticating with the SOCKS5 server. + /// + /// The password to use when authenticating with the SOCKS5 server. + private string Password + { + get + { + return _password; + } + set + { + if (value == null) + throw new ArgumentNullException(); + _password = value; + } + } + + /// + /// Gets or sets the bytes to use when sending a connect request to the proxy server. + /// + /// The array of bytes to use when sending a connect request to the proxy server. + private byte[] HandShake + { + get + { + return _handShake; + } + set + { + _handShake = value; + } + } + + // private variables + /// Holds the value of the Password property. + private string _password; + + /// Holds the value of the HandShake property. + private byte[] _handShake; + } +} diff --git a/src/Titanium.Web.Proxy/ProxySocket/SocksHandler.cs b/src/Titanium.Web.Proxy/ProxySocket/SocksHandler.cs new file mode 100644 index 000000000..144119a2e --- /dev/null +++ b/src/Titanium.Web.Proxy/ProxySocket/SocksHandler.cs @@ -0,0 +1,279 @@ +/* + Copyright © 2002, The KPD-Team + All rights reserved. + http://www.mentalis.org/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Neither the name of the KPD-Team, nor the names of its contributors + may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +using System; +using System.Net; +using System.Net.Sockets; + +namespace Titanium.Web.Proxy.ProxySocket +{ + /// + /// References the callback method to be called when the protocol negotiation is completed. + /// + internal delegate void HandShakeComplete(Exception error); + + /// + /// Implements a specific version of the SOCKS protocol. This is an abstract class; it must be inherited. + /// + internal abstract class SocksHandler + { + /// + /// Initializes a new instance of the SocksHandler class. + /// + /// The socket connection with the proxy server. + /// The username to use when authenticating with the server. + /// server -or- user is null. + public SocksHandler(Socket server, string user) + { + Server = server; + Username = user; + } + + /// + /// Converts a port number to an array of bytes. + /// + /// The port to convert. + /// An array of two bytes that represents the specified port. + protected byte[] PortToBytes(int port) + { + byte[] ret = new byte[2]; + ret[0] = (byte)(port / 256); + ret[1] = (byte)(port % 256); + return ret; + } + + /// + /// Converts an IP address to an array of bytes. + /// + /// The IP address to convert. + /// An array of four bytes that represents the specified IP address. + protected byte[] AddressToBytes(long address) + { + byte[] ret = new byte[4]; + ret[0] = (byte)(address % 256); + ret[1] = (byte)((address / 256) % 256); + ret[2] = (byte)((address / 65536) % 256); + ret[3] = (byte)(address / 16777216); + return ret; + } + + /// + /// Reads a specified number of bytes from the Server socket. + /// + /// The number of bytes to return. + /// An array of bytes. + /// The number of bytes to read is invalid. + /// An operating system error occurs while accessing the Socket. + /// The Socket has been closed. + protected byte[] ReadBytes(int count) + { + if (count <= 0) + throw new ArgumentException(); + byte[] buffer = new byte[count]; + int received = 0; + while (received != count) + { + int recv = Server.Receive(buffer, received, count - received, SocketFlags.None); + if (recv == 0) + { + throw new SocketException(10054); + } + + received += recv; + } + + return buffer; + } + + /// + /// Reads number of received bytes and ensures that socket was not shut down + /// + /// IAsyncResult for receive operation + /// + protected void HandleEndReceive(IAsyncResult ar) + { + int recv = Server.EndReceive(ar); + if (recv <= 0) + throw new SocketException(10054); + Received += recv; + } + + /// + /// Verifies that whole buffer was sent successfully + /// + /// IAsyncResult for receive operation + /// Length of buffer that was sent + /// + protected void HandleEndSend(IAsyncResult ar, int expectedLength) + { + if (Server.EndSend(ar) < expectedLength) + throw new SocketException(10054); + } + + /// + /// Gets or sets the socket connection with the proxy server. + /// + /// A Socket object that represents the connection with the proxy server. + /// The specified value is null. + protected Socket Server + { + get + { + return _server; + } + set + { + if (value == null) + throw new ArgumentNullException(); + _server = value; + } + } + + /// + /// Gets or sets the username to use when authenticating with the proxy server. + /// + /// A string that holds the username to use when authenticating with the proxy server. + /// The specified value is null. + protected string Username + { + get + { + return _username; + } + set + { + if (value == null) + throw new ArgumentNullException(); + _username = value; + } + } + + /// + /// Gets or sets the return value of the BeginConnect call. + /// + /// An IAsyncProxyResult object that is the return value of the BeginConnect call. + protected IAsyncProxyResult AsyncResult + { + get + { + return _asyncResult; + } + set + { + _asyncResult = value; + } + } + + /// + /// Gets or sets a byte buffer. + /// + /// An array of bytes. + protected byte[] Buffer + { + get + { + return _buffer; + } + set + { + _buffer = value; + } + } + + /// + /// Gets or sets the number of bytes that have been received from the remote proxy server. + /// + /// An integer that holds the number of bytes that have been received from the remote proxy server. + protected int Received + { + get + { + return _received; + } + set + { + _received = value; + } + } + + // private variables + /// Holds the value of the Server property. + private Socket _server; + + /// Holds the value of the Username property. + private string _username; + + /// Holds the value of the AsyncResult property. + private IAsyncProxyResult _asyncResult; + + /// Holds the value of the Buffer property. + private byte[] _buffer; + + /// Holds the value of the Received property. + private int _received; + + /// Holds the address of the method to call when the SOCKS protocol has been completed. + protected HandShakeComplete ProtocolComplete; + + /// + /// Starts negotiating with a SOCKS proxy server. + /// + /// The remote server to connect to. + /// The remote port to connect to. + public abstract void Negotiate(string host, int port); + + /// + /// Starts negotiating with a SOCKS proxy server. + /// + /// The remote endpoint to connect to. + public abstract void Negotiate(IPEndPoint remoteEP); + + /// + /// Starts negotiating asynchronously with a SOCKS proxy server. + /// + /// An IPEndPoint that represents the remote device. + /// The method to call when the connection has been established. + /// The IPEndPoint of the SOCKS proxy server. + /// An IAsyncProxyResult that references the asynchronous connection. + public abstract IAsyncProxyResult BeginNegotiate(IPEndPoint remoteEP, HandShakeComplete callback, + IPEndPoint proxyEndPoint); + + /// + /// Starts negotiating asynchronously with a SOCKS proxy server. + /// + /// The remote server to connect to. + /// The remote port to connect to. + /// The method to call when the connection has been established. + /// The IPEndPoint of the SOCKS proxy server. + /// An IAsyncProxyResult that references the asynchronous connection. + public abstract IAsyncProxyResult BeginNegotiate(string host, int port, HandShakeComplete callback, + IPEndPoint proxyEndPoint); + } +} From b67ad5d59657ac2d9b797655d581caa08ee71ebb Mon Sep 17 00:00:00 2001 From: Honfika Date: Tue, 24 Dec 2019 19:40:51 +0100 Subject: [PATCH 02/10] small refactor --- .../ProxyTestController.cs | 2 +- .../Network/Tcp/TcpConnectionFactory.cs | 90 +++++++++---------- 2 files changed, 42 insertions(+), 50 deletions(-) diff --git a/examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs b/examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs index 890e93987..9837de64e 100644 --- a/examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs +++ b/examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs @@ -91,7 +91,7 @@ public void StartProxy() //proxyServer.AddEndPoint(transparentEndPoint); //proxyServer.UpStreamHttpProxy = new ExternalProxy("localhost", 8888); - //proxyServer.UpStreamHttpsProxy = new ExternalProxy("localhost", 8888( }); + //proxyServer.UpStreamHttpsProxy = new ExternalProxy("localhost", 8888); // SOCKS proxy //proxyServer.UpStreamHttpProxy = new ExternalProxy("46.63.0.17", 4145) { ProxyType = ExternalProxyType.Socks4 }; diff --git a/src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs b/src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs index 28ff98c5f..c22fa8506 100644 --- a/src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs +++ b/src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs @@ -395,55 +395,9 @@ private async Task createServerConnection(string remoteHost tcpServerSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); } - Task connectTask; - if (socks) - { - var clientSocket = (ProxySocket.ProxySocket)tcpServerSocket; - - IAsyncResult BeginConnect(IPAddress address, int port, AsyncCallback requestCallback, - object state) - { - return clientSocket.BeginConnect(address, port, requestCallback, state); - } - - void EndConnect(IAsyncResult asyncResult) - { - var s = clientSocket; - if (s == null) - { - // Dispose nulls out the client socket field. - throw new ObjectDisposedException(GetType().Name); - } - - s.EndConnect(asyncResult); - } - - connectTask = Task.Factory.FromAsync(BeginConnect, EndConnect, ipAddress, port, state: this); - } - else - { - var clientSocket = tcpServerSocket; - - IAsyncResult BeginConnect(IPAddress address, int port, AsyncCallback requestCallback, - object state) - { - return clientSocket.BeginConnect(address, port, requestCallback, state); - } - - void EndConnect(IAsyncResult asyncResult) - { - var s = clientSocket; - if (s == null) - { - // Dispose nulls out the client socket field. - throw new ObjectDisposedException(GetType().Name); - } - - s.EndConnect(asyncResult); - } - - connectTask = Task.Factory.FromAsync(BeginConnect, EndConnect, ipAddress, port, state: this); - } + var connectTask = socks + ? ProxySocketConnectionTaskFactory.CreateTask((ProxySocket.ProxySocket)tcpServerSocket, ipAddress, port) + : SocketConnectionTaskFactory.CreateTask(tcpServerSocket, ipAddress, port); await Task.WhenAny(connectTask, Task.Delay(proxyServer.ConnectTimeOutSeconds * 1000, cancellationToken)); if (!connectTask.IsCompleted || !tcpServerSocket.Connected) @@ -767,5 +721,43 @@ public void Dispose() } } } + + static class SocketConnectionTaskFactory + { + static IAsyncResult beginConnect(IPAddress address, int port, AsyncCallback requestCallback, + object state) + { + return ((Socket)state).BeginConnect(address, port, requestCallback, state); + } + + static void endConnect(IAsyncResult asyncResult) + { + ((Socket)asyncResult.AsyncState).EndConnect(asyncResult); + } + + public static Task CreateTask(Socket socket, IPAddress ipAddress, int port) + { + return Task.Factory.FromAsync(beginConnect, endConnect, ipAddress, port, state: socket); + } + } + + static class ProxySocketConnectionTaskFactory + { + static IAsyncResult beginConnect(IPAddress address, int port, AsyncCallback requestCallback, + object state) + { + return ((ProxySocket.ProxySocket)state).BeginConnect(address, port, requestCallback, state); + } + + static void endConnect(IAsyncResult asyncResult) + { + ((ProxySocket.ProxySocket)asyncResult.AsyncState).EndConnect(asyncResult); + } + + public static Task CreateTask(ProxySocket.ProxySocket socket, IPAddress ipAddress, int port) + { + return Task.Factory.FromAsync(beginConnect, endConnect, ipAddress, port, state: socket); + } + } } } From 5bd2c5ce5df41f76e217cf2b5dbc70fddb6837c8 Mon Sep 17 00:00:00 2001 From: Honfika Date: Wed, 25 Dec 2019 08:47:37 +0100 Subject: [PATCH 03/10] socks endpoint --- .../ProxyTestController.cs | 9 ++ .../MainWindow.xaml.cs | 9 ++ src/Titanium.Web.Proxy/Http2/Http2Helper.cs | 5 +- .../Models/SocksProxyEndPoint.cs | 48 ++++++++ .../Models/TransparentBaseProxyEndPoint.cs | 19 +++ .../Models/TransparentProxyEndPoint.cs | 6 +- src/Titanium.Web.Proxy/Net45Compatibility.cs | 3 - .../Network/Tcp/TcpClientConnection.cs | 1 - .../Network/Tcp/TcpServerConnection.cs | 1 - src/Titanium.Web.Proxy/ProxyServer.cs | 10 +- .../ProxySocket/SocksHandler.cs | 64 ++-------- src/Titanium.Web.Proxy/RequestHandler.cs | 6 +- src/Titanium.Web.Proxy/ResponseHandler.cs | 1 - src/Titanium.Web.Proxy/SocksClientHandler.cs | 110 ++++++++++++++++++ .../TransparentClientHandler.cs | 13 ++- 15 files changed, 229 insertions(+), 76 deletions(-) create mode 100644 src/Titanium.Web.Proxy/Models/SocksProxyEndPoint.cs create mode 100644 src/Titanium.Web.Proxy/Models/TransparentBaseProxyEndPoint.cs create mode 100644 src/Titanium.Web.Proxy/SocksClientHandler.cs diff --git a/examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs b/examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs index 9837de64e..c419842cb 100644 --- a/examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs +++ b/examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs @@ -97,6 +97,15 @@ public void StartProxy() //proxyServer.UpStreamHttpProxy = new ExternalProxy("46.63.0.17", 4145) { ProxyType = ExternalProxyType.Socks4 }; //proxyServer.UpStreamHttpsProxy = new ExternalProxy("46.63.0.17", 4145) { ProxyType = ExternalProxyType.Socks4 }; + //var socksEndPoint = new SocksProxyEndPoint(IPAddress.Any, 1080, true) + //{ + // // Generic Certificate hostname to use + // // When SNI is disabled by client + // GenericCertificateName = "google.com" + //}; + + //proxyServer.AddEndPoint(socksEndPoint); + foreach (var endPoint in proxyServer.ProxyEndPoints) { Console.WriteLine("Listening on '{0}' endpoint at Ip {1} and port: {2} ", endPoint.GetType().Name, diff --git a/examples/Titanium.Web.Proxy.Examples.Wpf/MainWindow.xaml.cs b/examples/Titanium.Web.Proxy.Examples.Wpf/MainWindow.xaml.cs index 5573205ac..d3fec7226 100644 --- a/examples/Titanium.Web.Proxy.Examples.Wpf/MainWindow.xaml.cs +++ b/examples/Titanium.Web.Proxy.Examples.Wpf/MainWindow.xaml.cs @@ -81,6 +81,15 @@ public MainWindow() // Password = "Titanium", //}; + //var socksEndPoint = new SocksProxyEndPoint(IPAddress.Any, 1080, true) + //{ + // // Generic Certificate hostname to use + // // When SNI is disabled by client + // //GenericCertificateName = "google.com" + //}; + + //proxyServer.AddEndPoint(socksEndPoint); + proxyServer.BeforeRequest += ProxyServer_BeforeRequest; proxyServer.BeforeResponse += ProxyServer_BeforeResponse; proxyServer.AfterResponse += ProxyServer_AfterResponse; diff --git a/src/Titanium.Web.Proxy/Http2/Http2Helper.cs b/src/Titanium.Web.Proxy/Http2/Http2Helper.cs index 46ebe0e46..2dbcc5d7a 100644 --- a/src/Titanium.Web.Proxy/Http2/Http2Helper.cs +++ b/src/Titanium.Web.Proxy/Http2/Http2Helper.cs @@ -1,6 +1,4 @@ - -using Titanium.Web.Proxy.Extensions; -#if NETSTANDARD2_1 +#if NETSTANDARD2_1 using System; using System.Collections.Concurrent; using System.Diagnostics; @@ -12,6 +10,7 @@ using Titanium.Web.Proxy.Compression; using Titanium.Web.Proxy.EventArguments; using Titanium.Web.Proxy.Exceptions; +using Titanium.Web.Proxy.Extensions; using Titanium.Web.Proxy.Http; using Titanium.Web.Proxy.Http2.Hpack; using Titanium.Web.Proxy.Models; diff --git a/src/Titanium.Web.Proxy/Models/SocksProxyEndPoint.cs b/src/Titanium.Web.Proxy/Models/SocksProxyEndPoint.cs new file mode 100644 index 000000000..3cc428011 --- /dev/null +++ b/src/Titanium.Web.Proxy/Models/SocksProxyEndPoint.cs @@ -0,0 +1,48 @@ +using System.Diagnostics; +using System.Net; +using System.Threading.Tasks; +using Titanium.Web.Proxy.EventArguments; +using Titanium.Web.Proxy.Extensions; + +namespace Titanium.Web.Proxy.Models +{ + /// + /// A proxy end point client is not aware of. + /// Useful when requests are redirected to this proxy end point through port forwarding via router. + /// + [DebuggerDisplay("SOCKS: {IpAddress}:{Port}")] + public class SocksProxyEndPoint : TransparentBaseProxyEndPoint + { + /// + /// Initialize a new instance. + /// + /// Listening Ip address. + /// Listening port. + /// Should we decrypt ssl? + public SocksProxyEndPoint(IPAddress ipAddress, int port, bool decryptSsl = true) : base(ipAddress, port, + decryptSsl) + { + GenericCertificateName = "localhost"; + } + + /// + /// Name of the Certificate need to be sent (same as the hostname we want to proxy). + /// This is valid only when UseServerNameIndication is set to false. + /// + public override string GenericCertificateName { get; set; } + + /// + /// Before Ssl authentication this event is fired. + /// + public event AsyncEventHandler? BeforeSslAuthenticate; + + internal override async Task InvokeBeforeSslAuthenticate(ProxyServer proxyServer, + BeforeSslAuthenticateEventArgs connectArgs, ExceptionHandler exceptionFunc) + { + if (BeforeSslAuthenticate != null) + { + await BeforeSslAuthenticate.InvokeAsync(proxyServer, connectArgs, exceptionFunc); + } + } + } +} diff --git a/src/Titanium.Web.Proxy/Models/TransparentBaseProxyEndPoint.cs b/src/Titanium.Web.Proxy/Models/TransparentBaseProxyEndPoint.cs new file mode 100644 index 000000000..a3bd80780 --- /dev/null +++ b/src/Titanium.Web.Proxy/Models/TransparentBaseProxyEndPoint.cs @@ -0,0 +1,19 @@ +using System; +using System.Net; +using System.Threading.Tasks; +using Titanium.Web.Proxy.EventArguments; + +namespace Titanium.Web.Proxy.Models +{ + public abstract class TransparentBaseProxyEndPoint : ProxyEndPoint + { + public abstract string GenericCertificateName { get; set; } + + protected TransparentBaseProxyEndPoint(IPAddress ipAddress, int port, bool decryptSsl) : base(ipAddress, port, decryptSsl) + { + } + + internal abstract Task InvokeBeforeSslAuthenticate(ProxyServer proxyServer, + BeforeSslAuthenticateEventArgs connectArgs, ExceptionHandler exceptionFunc); + } +} diff --git a/src/Titanium.Web.Proxy/Models/TransparentProxyEndPoint.cs b/src/Titanium.Web.Proxy/Models/TransparentProxyEndPoint.cs index 8b0599e8e..6f58a4956 100644 --- a/src/Titanium.Web.Proxy/Models/TransparentProxyEndPoint.cs +++ b/src/Titanium.Web.Proxy/Models/TransparentProxyEndPoint.cs @@ -11,7 +11,7 @@ namespace Titanium.Web.Proxy.Models /// Useful when requests are redirected to this proxy end point through port forwarding via router. ///
[DebuggerDisplay("Transparent: {IpAddress}:{Port}")] - public class TransparentProxyEndPoint : ProxyEndPoint + public class TransparentProxyEndPoint : TransparentBaseProxyEndPoint { /// /// Initialize a new instance. @@ -29,14 +29,14 @@ public TransparentProxyEndPoint(IPAddress ipAddress, int port, bool decryptSsl = /// Name of the Certificate need to be sent (same as the hostname we want to proxy). /// This is valid only when UseServerNameIndication is set to false. /// - public string GenericCertificateName { get; set; } + public override string GenericCertificateName { get; set; } /// /// Before Ssl authentication this event is fired. /// public event AsyncEventHandler? BeforeSslAuthenticate; - internal async Task InvokeBeforeSslAuthenticate(ProxyServer proxyServer, + internal override async Task InvokeBeforeSslAuthenticate(ProxyServer proxyServer, BeforeSslAuthenticateEventArgs connectArgs, ExceptionHandler exceptionFunc) { if (BeforeSslAuthenticate != null) diff --git a/src/Titanium.Web.Proxy/Net45Compatibility.cs b/src/Titanium.Web.Proxy/Net45Compatibility.cs index 10abc197e..834996452 100644 --- a/src/Titanium.Web.Proxy/Net45Compatibility.cs +++ b/src/Titanium.Web.Proxy/Net45Compatibility.cs @@ -1,8 +1,5 @@ #if NET45 using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; namespace Titanium.Web.Proxy diff --git a/src/Titanium.Web.Proxy/Network/Tcp/TcpClientConnection.cs b/src/Titanium.Web.Proxy/Network/Tcp/TcpClientConnection.cs index 7e55681a8..003874627 100644 --- a/src/Titanium.Web.Proxy/Network/Tcp/TcpClientConnection.cs +++ b/src/Titanium.Web.Proxy/Network/Tcp/TcpClientConnection.cs @@ -5,7 +5,6 @@ using System.Net.Sockets; using System.Security.Authentication; using System.Threading.Tasks; -using Titanium.Web.Proxy.Extensions; using Titanium.Web.Proxy.Helpers; using Titanium.Web.Proxy.Models; diff --git a/src/Titanium.Web.Proxy/Network/Tcp/TcpServerConnection.cs b/src/Titanium.Web.Proxy/Network/Tcp/TcpServerConnection.cs index fd67928ba..93f2549a7 100644 --- a/src/Titanium.Web.Proxy/Network/Tcp/TcpServerConnection.cs +++ b/src/Titanium.Web.Proxy/Network/Tcp/TcpServerConnection.cs @@ -3,7 +3,6 @@ using System.Net.Security; using System.Net.Sockets; using System.Threading.Tasks; -using Titanium.Web.Proxy.Extensions; using Titanium.Web.Proxy.Helpers; using Titanium.Web.Proxy.Models; diff --git a/src/Titanium.Web.Proxy/ProxyServer.cs b/src/Titanium.Web.Proxy/ProxyServer.cs index d1f4a37a3..caeb294d4 100644 --- a/src/Titanium.Web.Proxy/ProxyServer.cs +++ b/src/Titanium.Web.Proxy/ProxyServer.cs @@ -798,13 +798,17 @@ private async Task handleClient(Socket tcpClientSocket, ProxyEndPoint endPoint) using (var clientConnection = new TcpClientConnection(this, tcpClientSocket)) { - if (endPoint is TransparentProxyEndPoint tep) + if (endPoint is ExplicitProxyEndPoint eep) + { + await handleClient(eep, clientConnection); + } + else if (endPoint is TransparentProxyEndPoint tep) { await handleClient(tep, clientConnection); } - else + else if (endPoint is SocksProxyEndPoint sep) { - await handleClient((ExplicitProxyEndPoint)endPoint, clientConnection); + await handleClient(sep, clientConnection); } } } diff --git a/src/Titanium.Web.Proxy/ProxySocket/SocksHandler.cs b/src/Titanium.Web.Proxy/ProxySocket/SocksHandler.cs index 144119a2e..19faa9894 100644 --- a/src/Titanium.Web.Proxy/ProxySocket/SocksHandler.cs +++ b/src/Titanium.Web.Proxy/ProxySocket/SocksHandler.cs @@ -144,16 +144,8 @@ protected void HandleEndSend(IAsyncResult ar, int expectedLength) /// The specified value is null. protected Socket Server { - get - { - return _server; - } - set - { - if (value == null) - throw new ArgumentNullException(); - _server = value; - } + get => _server; + set => _server = value ?? throw new ArgumentNullException(); } /// @@ -163,16 +155,8 @@ protected Socket Server /// The specified value is null. protected string Username { - get - { - return _username; - } - set - { - if (value == null) - throw new ArgumentNullException(); - _username = value; - } + get => _username; + set => _username = value ?? throw new ArgumentNullException(); } /// @@ -181,47 +165,21 @@ protected string Username /// An IAsyncProxyResult object that is the return value of the BeginConnect call. protected IAsyncProxyResult AsyncResult { - get - { - return _asyncResult; - } - set - { - _asyncResult = value; - } + get => _asyncResult; + set => _asyncResult = value; } /// /// Gets or sets a byte buffer. /// /// An array of bytes. - protected byte[] Buffer - { - get - { - return _buffer; - } - set - { - _buffer = value; - } - } + protected byte[] Buffer { get; set; } /// /// Gets or sets the number of bytes that have been received from the remote proxy server. /// /// An integer that holds the number of bytes that have been received from the remote proxy server. - protected int Received - { - get - { - return _received; - } - set - { - _received = value; - } - } + protected int Received { get; set; } // private variables /// Holds the value of the Server property. @@ -233,12 +191,6 @@ protected int Received /// Holds the value of the AsyncResult property. private IAsyncProxyResult _asyncResult; - /// Holds the value of the Buffer property. - private byte[] _buffer; - - /// Holds the value of the Received property. - private int _received; - /// Holds the address of the method to call when the SOCKS protocol has been completed. protected HandShakeComplete ProtocolComplete; diff --git a/src/Titanium.Web.Proxy/RequestHandler.cs b/src/Titanium.Web.Proxy/RequestHandler.cs index 18ddedb5f..ee8ec0ad8 100644 --- a/src/Titanium.Web.Proxy/RequestHandler.cs +++ b/src/Titanium.Web.Proxy/RequestHandler.cs @@ -32,9 +32,10 @@ public partial class ProxyServer /// The cancellation token source for this async task. /// The Connect request if this is a HTTPS request from explicit endpoint. /// Prefetched server connection for current client using Connect/SNI headers. + /// Is HTTPS private async Task handleHttpSessionRequest(ProxyEndPoint endPoint, HttpClientStream clientStream, CancellationTokenSource cancellationTokenSource, TunnelConnectSessionEventArgs? connectArgs = null, - Task? prefetchConnectionTask = null) + Task? prefetchConnectionTask = null, bool isHttps = false) { var connectRequest = connectArgs?.HttpClient.ConnectRequest; @@ -67,6 +68,8 @@ private async Task handleHttpSessionRequest(ProxyEndPoint endPoint, HttpClientSt UserData = connectArgs?.UserData }; + args.HttpClient.Request.IsHttps = isHttps; + try { try @@ -217,7 +220,6 @@ await HeaderParser.ReadHeaders(clientStream, args.HttpClient.Request.Headers, await tcpConnectionFactory.Release(connection); connection = null; } - } catch (Exception e) when (!(e is ProxyHttpException)) { diff --git a/src/Titanium.Web.Proxy/ResponseHandler.cs b/src/Titanium.Web.Proxy/ResponseHandler.cs index cf3eb3168..7e9d617eb 100644 --- a/src/Titanium.Web.Proxy/ResponseHandler.cs +++ b/src/Titanium.Web.Proxy/ResponseHandler.cs @@ -122,7 +122,6 @@ await serverStream.CopyBodyAsync(response, false, clientStream, TransformationMo } } - args.TimeLine["Response Sent"] = DateTime.Now; } diff --git a/src/Titanium.Web.Proxy/SocksClientHandler.cs b/src/Titanium.Web.Proxy/SocksClientHandler.cs new file mode 100644 index 000000000..cd0174e23 --- /dev/null +++ b/src/Titanium.Web.Proxy/SocksClientHandler.cs @@ -0,0 +1,110 @@ +using System; +using System.Threading; +using System.Threading.Tasks; +using Titanium.Web.Proxy.Extensions; +using Titanium.Web.Proxy.Models; +using Titanium.Web.Proxy.Network.Tcp; + +namespace Titanium.Web.Proxy +{ + public partial class ProxyServer + { + /// + /// 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 + /// + /// The transparent endpoint. + /// The client connection. + /// + private async Task handleClient(SocksProxyEndPoint endPoint, TcpClientConnection clientConnection) + { + var cancellationTokenSource = new CancellationTokenSource(); + var cancellationToken = cancellationTokenSource.Token; + + var stream = clientConnection.GetStream(); + var buffer = BufferPool.GetBuffer(); + int port = 0; + try + { + int read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken); + if (read < 3) + { + return; + } + + if (buffer[0] == 4) + { + if (read < 9 || buffer[1] != 1) + { + // not a connect request + return; + } + + port = (buffer[2] << 8) + buffer[3]; + + buffer[0] = 0; + buffer[1] = 90; // request granted + await stream.WriteAsync(buffer, 0, 8, cancellationToken); + } + else if (buffer[0] == 5) + { + if (buffer[1] == 0 || buffer[2] != 0) + { + return; + } + + buffer[1] = 0; + await stream.WriteAsync(buffer, 0, 2, cancellationToken); + read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken); + if (read < 10 || buffer[1] != 1) + { + return; + } + + int portIdx; + switch (buffer[3]) + { + case 1: + // IPv4 + portIdx = 8; + break; + case 3: + // Domainname + portIdx = buffer[4] + 5; + +#if DEBUG + var hostname = new ByteString(buffer.AsMemory(5, buffer[4])); + string hostnameStr = hostname.GetString(); +#endif + break; + case 4: + // IPv6 + portIdx = 20; + break; + default: + return; + } + + if (read < portIdx + 2) + { + return; + } + + port = (buffer[portIdx] << 8) + buffer[portIdx + 1]; + buffer[1] = 0; // succeeded + await stream.WriteAsync(buffer, 0, read, cancellationToken); + } + else + { + return; + } + } + finally + { + BufferPool.ReturnBuffer(buffer); + } + + await handleClient(endPoint, clientConnection, port, cancellationTokenSource, cancellationToken); + } + } +} diff --git a/src/Titanium.Web.Proxy/TransparentClientHandler.cs b/src/Titanium.Web.Proxy/TransparentClientHandler.cs index 0c8342aa3..56cdda24d 100644 --- a/src/Titanium.Web.Proxy/TransparentClientHandler.cs +++ b/src/Titanium.Web.Proxy/TransparentClientHandler.cs @@ -25,11 +25,17 @@ public partial class ProxyServer /// The transparent endpoint. /// The client connection. /// - private async Task handleClient(TransparentProxyEndPoint endPoint, TcpClientConnection clientConnection) + private Task handleClient(TransparentProxyEndPoint endPoint, TcpClientConnection clientConnection) { var cancellationTokenSource = new CancellationTokenSource(); var cancellationToken = cancellationTokenSource.Token; + return handleClient(endPoint, clientConnection, endPoint.Port, cancellationTokenSource, cancellationToken); + } + private async Task handleClient(TransparentBaseProxyEndPoint endPoint, TcpClientConnection clientConnection, + int port, CancellationTokenSource cancellationTokenSource, CancellationToken cancellationToken) + { + bool isHttps = false; var clientStream = new HttpClientStream(clientConnection, clientConnection.GetStream(), BufferPool, cancellationToken); try @@ -70,6 +76,7 @@ private async Task handleClient(TransparentProxyEndPoint endPoint, TcpClientConn // HTTPS server created - we can now decrypt the client's traffic clientStream = new HttpClientStream(clientStream.Connection, sslStream, BufferPool, cancellationToken); sslStream = null; // clientStream was created, no need to keep SSL stream reference + isHttps = true; } catch (Exception e) { @@ -84,7 +91,7 @@ private async Task handleClient(TransparentProxyEndPoint endPoint, TcpClientConn else { var sessionArgs = new SessionEventArgs(this, endPoint, clientStream, null, cancellationTokenSource); - var connection = await tcpConnectionFactory.GetServerConnection(this, httpsHostName, endPoint.Port, + var connection = await tcpConnectionFactory.GetServerConnection(this, httpsHostName, port, HttpHeader.VersionUnknown, false, null, true, sessionArgs, UpStreamEndPoint, UpStreamHttpsProxy, true, cancellationToken); @@ -126,7 +133,7 @@ await TcpHelper.SendRaw(clientStream, connection.Stream, BufferPool, // HTTPS server created - we can now decrypt the client's traffic // Now create the request - await handleHttpSessionRequest(endPoint, clientStream, cancellationTokenSource); + await handleHttpSessionRequest(endPoint, clientStream, cancellationTokenSource, isHttps: isHttps); } catch (ProxyException e) { From 270c57c972505850960e005ed0b5f0aefa6d9974 Mon Sep 17 00:00:00 2001 From: Honfika Date: Wed, 25 Dec 2019 16:02:50 +0100 Subject: [PATCH 04/10] soks4 cleanup --- .../Authentication/AuthUserPass.cs | 6 +- .../ProxySocket/HttpsHandler.cs | 20 +- .../ProxySocket/ProxySocket.cs | 178 ++++++------------ .../ProxySocket/Socks4Handler.cs | 128 ++++++++----- .../ProxySocket/Socks5Handler.cs | 32 ++-- .../ProxySocket/SocksHandler.cs | 34 ++-- 6 files changed, 192 insertions(+), 206 deletions(-) diff --git a/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthUserPass.cs b/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthUserPass.cs index fed804d21..dbe547236 100644 --- a/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthUserPass.cs +++ b/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthUserPass.cs @@ -110,7 +110,7 @@ public override void BeginAuthenticate(HandShakeComplete callback) { CallBack = callback; Server.BeginSend(GetAuthenticationBytes(), 0, GetAuthenticationLength(), SocketFlags.None, - new AsyncCallback(this.OnSent), Server); + this.OnSent, Server); return; } @@ -125,7 +125,7 @@ private void OnSent(IAsyncResult ar) if (Server.EndSend(ar) < GetAuthenticationLength()) throw new SocketException(10054); Buffer = new byte[2]; - Server.BeginReceive(Buffer, 0, 2, SocketFlags.None, new AsyncCallback(this.OnReceive), Server); + Server.BeginReceive(Buffer, 0, 2, SocketFlags.None, this.OnReceive, Server); } catch (Exception e) { @@ -152,7 +152,7 @@ private void OnReceive(IAsyncResult ar) throw new ProxyException("Username/password combination not accepted."); else Server.BeginReceive(Buffer, Received, Buffer.Length - Received, SocketFlags.None, - new AsyncCallback(this.OnReceive), Server); + this.OnReceive, Server); } catch (Exception e) { diff --git a/src/Titanium.Web.Proxy/ProxySocket/HttpsHandler.cs b/src/Titanium.Web.Proxy/ProxySocket/HttpsHandler.cs index 3ed82a0f1..88df5e4f7 100644 --- a/src/Titanium.Web.Proxy/ProxySocket/HttpsHandler.cs +++ b/src/Titanium.Web.Proxy/ProxySocket/HttpsHandler.cs @@ -170,11 +170,12 @@ public override void Negotiate(string host, int port) /// An IPEndPoint that represents the remote device. /// The method to call when the negotiation is complete. /// The IPEndPoint of the HTTPS proxy server. + /// The state. /// An IAsyncProxyResult that references the asynchronous connection. public override IAsyncProxyResult BeginNegotiate(IPEndPoint remoteEP, HandShakeComplete callback, - IPEndPoint proxyEndPoint) + IPEndPoint proxyEndPoint, object state) { - return BeginNegotiate(remoteEP.Address.ToString(), remoteEP.Port, callback, proxyEndPoint); + return BeginNegotiate(remoteEP.Address.ToString(), remoteEP.Port, callback, proxyEndPoint, state); } /// @@ -184,14 +185,15 @@ public override IAsyncProxyResult BeginNegotiate(IPEndPoint remoteEP, HandShakeC /// The port to connect to. /// The method to call when the negotiation is complete. /// The IPEndPoint of the HTTPS proxy server. + /// The state. /// An IAsyncProxyResult that references the asynchronous connection. public override IAsyncProxyResult BeginNegotiate(string host, int port, HandShakeComplete callback, - IPEndPoint proxyEndPoint) + IPEndPoint proxyEndPoint, object state) { ProtocolComplete = callback; Buffer = GetConnectBytes(host, port); - Server.BeginConnect(proxyEndPoint, new AsyncCallback(this.OnConnect), Server); - AsyncResult = new IAsyncProxyResult(); + Server.BeginConnect(proxyEndPoint, this.OnConnect, Server); + AsyncResult = new IAsyncProxyResult(state); return AsyncResult; } @@ -213,7 +215,7 @@ private void OnConnect(IAsyncResult ar) try { - Server.BeginSend(Buffer, 0, Buffer.Length, SocketFlags.None, new AsyncCallback(this.OnConnectSent), + Server.BeginSend(Buffer, 0, Buffer.Length, SocketFlags.None, this.OnConnectSent, null); } catch (Exception e) @@ -233,7 +235,7 @@ private void OnConnectSent(IAsyncResult ar) HandleEndSend(ar, Buffer.Length); Buffer = new byte[13]; Received = 0; - Server.BeginReceive(Buffer, 0, 13, SocketFlags.None, new AsyncCallback(this.OnConnectReceive), Server); + Server.BeginReceive(Buffer, 0, 13, SocketFlags.None, this.OnConnectReceive, Server); } catch (Exception e) { @@ -262,7 +264,7 @@ private void OnConnectReceive(IAsyncResult ar) if (Received < 13) { Server.BeginReceive(Buffer, Received, 13 - Received, SocketFlags.None, - new AsyncCallback(this.OnConnectReceive), Server); + this.OnConnectReceive, Server); } else { @@ -305,7 +307,7 @@ private void ReadUntilHeadersEnd(bool readFirstByte) } else { - Server.BeginReceive(Buffer, 0, 1, SocketFlags.None, new AsyncCallback(this.OnEndHeadersReceive), + Server.BeginReceive(Buffer, 0, 1, SocketFlags.None, this.OnEndHeadersReceive, Server); } } diff --git a/src/Titanium.Web.Proxy/ProxySocket/ProxySocket.cs b/src/Titanium.Web.Proxy/ProxySocket/ProxySocket.cs index 30b6f0987..4dfed60de 100644 --- a/src/Titanium.Web.Proxy/ProxySocket/ProxySocket.cs +++ b/src/Titanium.Web.Proxy/ProxySocket/ProxySocket.cs @@ -31,6 +31,7 @@ OF THE POSSIBILITY OF SUCH DAMAGE. using System; using System.Net; using System.Net.Sockets; +using System.Security.AccessControl; // Implements a number of classes to allow Sockets to connect trough a firewall. namespace Titanium.Web.Proxy.ProxySocket @@ -191,34 +192,35 @@ public ProxySocket(AddressFamily addressFamily, SocketType socketType, ProtocolT { if (remoteEP == null) throw new ArgumentNullException(); - if (this.ProtocolType != ProtocolType.Tcp || ProxyType == ProxyTypes.None || ProxyEndPoint == null) + + if (ProtocolType != ProtocolType.Tcp || ProxyType == ProxyTypes.None || ProxyEndPoint == null) { return base.BeginConnect(remoteEP, callback, state); } - else + + CallBack = callback; + if (ProxyType == ProxyTypes.Https) { - CallBack = callback; - if (ProxyType == ProxyTypes.Https) - { - AsyncResult = (new HttpsHandler(this, ProxyUser, ProxyPass)).BeginNegotiate((IPEndPoint)remoteEP, - new HandShakeComplete(this.OnHandShakeComplete), ProxyEndPoint); - return AsyncResult; - } - else if (ProxyType == ProxyTypes.Socks4) - { - AsyncResult = (new Socks4Handler(this, ProxyUser)).BeginNegotiate((IPEndPoint)remoteEP, - new HandShakeComplete(this.OnHandShakeComplete), ProxyEndPoint); - return AsyncResult; - } - else if (ProxyType == ProxyTypes.Socks5) - { - AsyncResult = (new Socks5Handler(this, ProxyUser, ProxyPass)).BeginNegotiate((IPEndPoint)remoteEP, - new HandShakeComplete(this.OnHandShakeComplete), ProxyEndPoint); - return AsyncResult; - } + AsyncResult = new HttpsHandler(this, ProxyUser, ProxyPass).BeginNegotiate((IPEndPoint)remoteEP, + OnHandShakeComplete, ProxyEndPoint, state); + return AsyncResult; + } - return null; + if (ProxyType == ProxyTypes.Socks4) + { + AsyncResult = new Socks4Handler(this, ProxyUser).BeginNegotiate((IPEndPoint)remoteEP, + OnHandShakeComplete, ProxyEndPoint, state); + return AsyncResult; } + + if (ProxyType == ProxyTypes.Socks5) + { + AsyncResult = new Socks5Handler(this, ProxyUser, ProxyPass).BeginNegotiate((IPEndPoint)remoteEP, + OnHandShakeComplete, ProxyEndPoint, state); + return AsyncResult; + } + + return null; } /// @@ -243,7 +245,7 @@ public ProxySocket(AddressFamily addressFamily, SocketType socketType, ProtocolT if (this.ProtocolType != ProtocolType.Tcp || ProxyType == ProxyTypes.None || ProxyEndPoint == null) { RemotePort = port; - AsyncResult = BeginDns(host, new HandShakeComplete(this.OnHandShakeComplete)); + AsyncResult = BeginDns(host, this.OnHandShakeComplete, state); return AsyncResult; } else @@ -251,19 +253,21 @@ public ProxySocket(AddressFamily addressFamily, SocketType socketType, ProtocolT if (ProxyType == ProxyTypes.Https) { AsyncResult = (new HttpsHandler(this, ProxyUser, ProxyPass)).BeginNegotiate(host, port, - new HandShakeComplete(this.OnHandShakeComplete), ProxyEndPoint); + this.OnHandShakeComplete, ProxyEndPoint, state); return AsyncResult; } - else if (ProxyType == ProxyTypes.Socks4) + + if (ProxyType == ProxyTypes.Socks4) { AsyncResult = (new Socks4Handler(this, ProxyUser)).BeginNegotiate(host, port, - new HandShakeComplete(this.OnHandShakeComplete), ProxyEndPoint); + this.OnHandShakeComplete, ProxyEndPoint, state); return AsyncResult; } - else if (ProxyType == ProxyTypes.Socks5) + + if (ProxyType == ProxyTypes.Socks5) { AsyncResult = (new Socks5Handler(this, ProxyUser, ProxyPass)).BeginNegotiate(host, port, - new HandShakeComplete(this.OnHandShakeComplete), ProxyEndPoint); + this.OnHandShakeComplete, ProxyEndPoint, state); return AsyncResult; } @@ -304,14 +308,15 @@ public ProxySocket(AddressFamily addressFamily, SocketType socketType, ProtocolT /// /// The host to resolve. /// The method to call when the hostname has been resolved. + /// The state. /// An IAsyncResult instance that references the asynchronous request. /// There was an error while trying to resolve the host. - internal IAsyncProxyResult BeginDns(string host, HandShakeComplete callback) + internal IAsyncProxyResult BeginDns(string host, HandShakeComplete callback, object state) { try { - Dns.BeginGetHostEntry(host, new AsyncCallback(this.OnResolved), this); - return new IAsyncProxyResult(); + Dns.BeginGetHostEntry(host, this.OnResolved, this); + return new IAsyncProxyResult(state); } catch { @@ -328,7 +333,7 @@ private void OnResolved(IAsyncResult asyncResult) try { IPHostEntry dns = Dns.EndGetHostEntry(asyncResult); - base.BeginConnect(new IPEndPoint(dns.AddressList[0], RemotePort), new AsyncCallback(this.OnConnect), + base.BeginConnect(new IPEndPoint(dns.AddressList[0], RemotePort), this.OnConnect, State); } catch (Exception e) @@ -358,47 +363,27 @@ private void OnConnect(IAsyncResult asyncResult) /// Called when the Socket has finished talking to the proxy server and is ready to relay data. /// /// The error to throw when the EndConnect method is called. - private void OnHandShakeComplete(Exception error) + private void OnHandShakeComplete(Exception? error) { if (error != null) this.Close(); + ToThrow = error; + CallBack?.Invoke(AsyncResult); AsyncResult.Reset(); - if (CallBack != null) - CallBack(AsyncResult); } /// /// Gets or sets the EndPoint of the proxy server. /// /// An IPEndPoint object that holds the IP address and the port of the proxy server. - public IPEndPoint ProxyEndPoint - { - get - { - return _proxyEndPoint; - } - set - { - _proxyEndPoint = value; - } - } + public IPEndPoint ProxyEndPoint { get; set; } /// /// Gets or sets the type of proxy server to use. /// /// One of the ProxyTypes values. - public ProxyTypes ProxyType - { - get - { - return _proxyType; - } - set - { - _proxyType = value; - } - } + public ProxyTypes ProxyType { get; set; } = ProxyTypes.None; /// /// Gets or sets a user-defined object. @@ -421,16 +406,10 @@ private object State /// /// A string that holds the username that's used when authenticating with the proxy. /// The specified value is null. - public string? ProxyUser + public string ProxyUser { - get - { - return _proxyUser; - } - set - { - _proxyUser = value ?? throw new ArgumentNullException(); - } + get => _proxyUser; + set => _proxyUser = value ?? throw new ArgumentNullException(); } /// @@ -438,92 +417,41 @@ public string? ProxyUser /// /// A string that holds the password that's used when authenticating with the proxy. /// The specified value is null. - public string? ProxyPass + public string ProxyPass { - get - { - return _proxyPass; - } - set - { - _proxyPass = value ?? throw new ArgumentNullException(); - } + get => _proxyPass; + set => _proxyPass = value ?? throw new ArgumentNullException(); } /// /// Gets or sets the asynchronous result object. /// /// An instance of the IAsyncProxyResult class. - private IAsyncProxyResult AsyncResult - { - get - { - return _asyncResult; - } - set - { - _asyncResult = value; - } - } + private IAsyncProxyResult AsyncResult { get; set; } /// /// Gets or sets the exception to throw when the EndConnect method is called. /// /// An instance of the Exception class (or subclasses of Exception). - private Exception ToThrow - { - get - { - return _toThrow; - } - set - { - _toThrow = value; - } - } + private Exception? ToThrow { get; set; } /// /// Gets or sets the remote port the user wants to connect to. /// /// An integer that specifies the port the user wants to connect to. - private int RemotePort - { - get - { - return _remotePort; - } - set - { - _remotePort = value; - } - } + private int RemotePort { get; set; } // private variables /// Holds the value of the State property. private object _state; - /// Holds the value of the ProxyEndPoint property. - private IPEndPoint _proxyEndPoint; - - /// Holds the value of the ProxyType property. - private ProxyTypes _proxyType = ProxyTypes.None; - /// Holds the value of the ProxyUser property. - private string? _proxyUser; + private string _proxyUser = string.Empty; /// Holds the value of the ProxyPass property. - private string? _proxyPass; + private string _proxyPass = string.Empty; /// Holds a pointer to the method that should be called when the Socket is connected to the remote device. private AsyncCallback CallBack; - - /// Holds the value of the AsyncResult property. - private IAsyncProxyResult _asyncResult; - - /// Holds the value of the ToThrow property. - private Exception _toThrow; - - /// Holds the value of the RemotePort property. - private int _remotePort; } } diff --git a/src/Titanium.Web.Proxy/ProxySocket/Socks4Handler.cs b/src/Titanium.Web.Proxy/ProxySocket/Socks4Handler.cs index f7beb1947..6e39b0f50 100644 --- a/src/Titanium.Web.Proxy/ProxySocket/Socks4Handler.cs +++ b/src/Titanium.Web.Proxy/ProxySocket/Socks4Handler.cs @@ -29,6 +29,7 @@ OF THE POSSIBILITY OF SUCH DAMAGE. */ using System; +using System.Buffers; using System.Net; using System.Net.Sockets; using System.Text; @@ -53,47 +54,61 @@ public Socks4Handler(Socket server, string user) : base(server, user) { } /// /// The host to connect to. /// The port to connect to. + /// The buffer which contains the result data. /// An array of bytes that has to be sent when the user wants to connect to a specific host/port combination. /// Resolving the host name will be done at server side. Do note that some SOCKS4 servers do not implement this functionality. /// host is null. /// port is invalid. - private byte[] GetHostPortBytes(string host, int port) + private int GetHostPortBytes(string host, int port, Memory buffer) { if (host == null) - throw new ArgumentNullException(); + throw new ArgumentNullException(nameof(host)); + if (port <= 0 || port > 65535) - throw new ArgumentException(); - byte[] connect = new byte[10 + Username.Length + host.Length]; + throw new ArgumentException(nameof(port)); + + int length = 10 + Username.Length + host.Length; + if (buffer.Length < length) + throw new ArgumentException(nameof(buffer)); + + var connect = buffer.Span; connect[0] = 4; connect[1] = 1; - Array.Copy(PortToBytes(port), 0, connect, 2, 2); + PortToBytes(port, connect.Slice(2)); connect[4] = connect[5] = connect[6] = 0; connect[7] = 1; - Array.Copy(Encoding.ASCII.GetBytes(Username), 0, connect, 8, Username.Length); + var userNameArray = Encoding.ASCII.GetBytes(Username); + userNameArray.CopyTo(connect.Slice(8)); connect[8 + Username.Length] = 0; - Array.Copy(Encoding.ASCII.GetBytes(host), 0, connect, 9 + Username.Length, host.Length); + Encoding.ASCII.GetBytes(host).CopyTo(connect.Slice(9 + userNameArray.Length)); connect[9 + Username.Length + host.Length] = 0; - return connect; + return length; } /// /// Creates an array of bytes that has to be sent when the user wants to connect to a specific IPEndPoint. /// /// The IPEndPoint to connect to. + /// The buffer which contains the result data. /// An array of bytes that has to be sent when the user wants to connect to a specific IPEndPoint. /// remoteEP is null. - private byte[] GetEndPointBytes(IPEndPoint remoteEP) + private int GetEndPointBytes(IPEndPoint remoteEP, Memory buffer) { if (remoteEP == null) - throw new ArgumentNullException(); - byte[] connect = new byte[9 + Username.Length]; + throw new ArgumentNullException(nameof(remoteEP)); + + int length = 9 + Username.Length; + if (buffer.Length < length) + throw new ArgumentException(nameof(buffer)); + + var connect = buffer.Span; connect[0] = 4; connect[1] = 1; - Array.Copy(PortToBytes(remoteEP.Port), 0, connect, 2, 2); - Array.Copy(remoteEP.Address.GetAddressBytes(), 0, connect, 4, 4); - Array.Copy(Encoding.ASCII.GetBytes(Username), 0, connect, 8, Username.Length); + PortToBytes(remoteEP.Port, connect.Slice(2)); + remoteEP.Address.GetAddressBytes().CopyTo(connect.Slice(4)); + Encoding.ASCII.GetBytes(Username).CopyTo(connect.Slice(8)); connect[8 + Username.Length] = 0; - return connect; + return length; } /// @@ -108,7 +123,16 @@ private byte[] GetEndPointBytes(IPEndPoint remoteEP) /// The Socket has been closed. public override void Negotiate(string host, int port) { - Negotiate(GetHostPortBytes(host, port)); + var buffer = ArrayPool.Shared.Rent(1024); + try + { + int length = GetHostPortBytes(host, port, buffer); + Negotiate(buffer, length); + } + finally + { + ArrayPool.Shared.Return(buffer); + } } /// @@ -121,26 +145,36 @@ public override void Negotiate(string host, int port) /// The Socket has been closed. public override void Negotiate(IPEndPoint remoteEP) { - Negotiate(GetEndPointBytes(remoteEP)); + var buffer = ArrayPool.Shared.Rent(1024); + try + { + int length = GetEndPointBytes(remoteEP, buffer); + Negotiate(buffer, length); + } + finally + { + ArrayPool.Shared.Return(buffer); + } } /// /// Starts negotiating with the SOCKS server. /// /// The bytes to send when trying to authenticate. + /// The byte count to send when trying to authenticate. /// connect is null. /// connect is too small. /// The proxy rejected the request. /// An operating system error occurs while accessing the Socket. /// The Socket has been closed. - private void Negotiate(byte[] connect) + private void Negotiate(byte[] connect, int length) { - if (connect == null) - throw new ArgumentNullException(); if (connect.Length < 2) throw new ArgumentException(); - if (Server.Send(connect) < connect.Length) + + if (Server.Send(connect, 0, length, SocketFlags.None) < connect.Length) throw new SocketException(10054); + byte[] buffer = ReadBytes(8); if (buffer[1] != 90) { @@ -156,14 +190,16 @@ private void Negotiate(byte[] connect) /// The remote port to connect to. /// The method to call when the connection has been established. /// The IPEndPoint of the SOCKS proxy server. + /// The state. /// An IAsyncProxyResult that references the asynchronous connection. public override IAsyncProxyResult BeginNegotiate(string host, int port, HandShakeComplete callback, - IPEndPoint proxyEndPoint) + IPEndPoint proxyEndPoint, object state) { ProtocolComplete = callback; - Buffer = GetHostPortBytes(host, port); - Server.BeginConnect(proxyEndPoint, new AsyncCallback(this.OnConnect), Server); - AsyncResult = new IAsyncProxyResult(); + Buffer = ArrayPool.Shared.Rent(1024); + BufferCount = GetHostPortBytes(host, port, Buffer); + Server.BeginConnect(proxyEndPoint, OnConnect, Server); + AsyncResult = new IAsyncProxyResult(state); return AsyncResult; } @@ -173,14 +209,16 @@ public override IAsyncProxyResult BeginNegotiate(string host, int port, HandShak /// An IPEndPoint that represents the remote device. /// The method to call when the connection has been established. /// The IPEndPoint of the SOCKS proxy server. + /// The state. /// An IAsyncProxyResult that references the asynchronous connection. public override IAsyncProxyResult BeginNegotiate(IPEndPoint remoteEP, HandShakeComplete callback, - IPEndPoint proxyEndPoint) + IPEndPoint proxyEndPoint, object state) { ProtocolComplete = callback; - Buffer = GetEndPointBytes(remoteEP); - Server.BeginConnect(proxyEndPoint, new AsyncCallback(this.OnConnect), Server); - AsyncResult = new IAsyncProxyResult(); + Buffer = ArrayPool.Shared.Rent(1024); + BufferCount = GetEndPointBytes(remoteEP, Buffer); + Server.BeginConnect(proxyEndPoint, OnConnect, Server); + AsyncResult = new IAsyncProxyResult(state); return AsyncResult; } @@ -196,17 +234,17 @@ private void OnConnect(IAsyncResult ar) } catch (Exception e) { - ProtocolComplete(e); + OnProtocolComplete(e); return; } try { - Server.BeginSend(Buffer, 0, Buffer.Length, SocketFlags.None, new AsyncCallback(this.OnSent), Server); + Server.BeginSend(Buffer, 0, BufferCount, SocketFlags.None, OnSent, Server); } catch (Exception e) { - ProtocolComplete(e); + OnProtocolComplete(e); } } @@ -218,24 +256,22 @@ private void OnSent(IAsyncResult ar) { try { - HandleEndSend(ar, Buffer.Length); + HandleEndSend(ar, BufferCount); } catch (Exception e) { - ProtocolComplete(e); + OnProtocolComplete(e); return; } try { - Buffer = new byte[8]; Received = 0; - Server.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, new AsyncCallback(this.OnReceive), - Server); + Server.BeginReceive(Buffer, 0, 8, SocketFlags.None, OnReceive, Server); } catch (Exception e) { - ProtocolComplete(e); + OnProtocolComplete(e); } } @@ -251,23 +287,29 @@ private void OnReceive(IAsyncResult ar) if (Received == 8) { if (Buffer[1] == 90) - ProtocolComplete(null); + OnProtocolComplete(null); else { Server.Close(); - ProtocolComplete(new ProxyException("Negotiation failed.")); + OnProtocolComplete(new ProxyException("Negotiation failed.")); } } else { - Server.BeginReceive(Buffer, Received, Buffer.Length - Received, SocketFlags.None, - new AsyncCallback(this.OnReceive), Server); + Server.BeginReceive(Buffer, Received, Buffer.Length - Received, SocketFlags.None, OnReceive, + Server); } } catch (Exception e) { - ProtocolComplete(e); + OnProtocolComplete(e); } } + + private void OnProtocolComplete(Exception? exception) + { + ArrayPool.Shared.Return(Buffer); + ProtocolComplete(exception); + } } } diff --git a/src/Titanium.Web.Proxy/ProxySocket/Socks5Handler.cs b/src/Titanium.Web.Proxy/ProxySocket/Socks5Handler.cs index 2049254ab..135809581 100644 --- a/src/Titanium.Web.Proxy/ProxySocket/Socks5Handler.cs +++ b/src/Titanium.Web.Proxy/ProxySocket/Socks5Handler.cs @@ -220,14 +220,15 @@ private void Negotiate(byte[] connect) /// The port to connect to. /// The method to call when the negotiation is complete. /// The IPEndPoint of the SOCKS proxy server. + /// The state. /// An IAsyncProxyResult that references the asynchronous connection. public override IAsyncProxyResult BeginNegotiate(string host, int port, HandShakeComplete callback, - IPEndPoint proxyEndPoint) + IPEndPoint proxyEndPoint, object state) { ProtocolComplete = callback; HandShake = GetHostPortBytes(host, port); - Server.BeginConnect(proxyEndPoint, new AsyncCallback(this.OnConnect), Server); - AsyncResult = new IAsyncProxyResult(); + Server.BeginConnect(proxyEndPoint, this.OnConnect, Server); + AsyncResult = new IAsyncProxyResult(state); return AsyncResult; } @@ -237,14 +238,15 @@ public override IAsyncProxyResult BeginNegotiate(string host, int port, HandShak /// An IPEndPoint that represents the remote device. /// The method to call when the negotiation is complete. /// The IPEndPoint of the SOCKS proxy server. + /// The state. /// An IAsyncProxyResult that references the asynchronous connection. public override IAsyncProxyResult BeginNegotiate(IPEndPoint remoteEP, HandShakeComplete callback, - IPEndPoint proxyEndPoint) + IPEndPoint proxyEndPoint, object state) { ProtocolComplete = callback; HandShake = GetEndPointBytes(remoteEP); - Server.BeginConnect(proxyEndPoint, new AsyncCallback(this.OnConnect), Server); - AsyncResult = new IAsyncProxyResult(); + Server.BeginConnect(proxyEndPoint, this.OnConnect, Server); + AsyncResult = new IAsyncProxyResult(state); return AsyncResult; } @@ -266,7 +268,7 @@ private void OnConnect(IAsyncResult ar) try { - Server.BeginSend(new byte[] { 5, 2, 0, 2 }, 0, 4, SocketFlags.None, new AsyncCallback(this.OnAuthSent), + Server.BeginSend(new byte[] { 5, 2, 0, 2 }, 0, 4, SocketFlags.None, this.OnAuthSent, Server); } catch (Exception e) @@ -295,7 +297,7 @@ private void OnAuthSent(IAsyncResult ar) { Buffer = new byte[1024]; Received = 0; - Server.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, new AsyncCallback(this.OnAuthReceive), + Server.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, this.OnAuthReceive, Server); } catch (Exception e) @@ -325,7 +327,7 @@ private void OnAuthReceive(IAsyncResult ar) if (Received < 2) { Server.BeginReceive(Buffer, Received, Buffer.Length - Received, SocketFlags.None, - new AsyncCallback(this.OnAuthReceive), Server); + this.OnAuthReceive, Server); } else { @@ -343,7 +345,7 @@ private void OnAuthReceive(IAsyncResult ar) return; } - authenticate.BeginAuthenticate(new HandShakeComplete(this.OnAuthenticated)); + authenticate.BeginAuthenticate(this.OnAuthenticated); } } catch (Exception e) @@ -366,7 +368,7 @@ private void OnAuthenticated(Exception e) try { - Server.BeginSend(HandShake, 0, HandShake.Length, SocketFlags.None, new AsyncCallback(this.OnSent), + Server.BeginSend(HandShake, 0, HandShake.Length, SocketFlags.None, this.OnSent, Server); } catch (Exception ex) @@ -395,7 +397,7 @@ private void OnSent(IAsyncResult ar) { Buffer = new byte[5]; Received = 0; - Server.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, new AsyncCallback(this.OnReceive), + Server.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, this.OnReceive, Server); } catch (Exception e) @@ -426,7 +428,7 @@ private void OnReceive(IAsyncResult ar) ProcessReply(Buffer); else Server.BeginReceive(Buffer, Received, Buffer.Length - Received, SocketFlags.None, - new AsyncCallback(this.OnReceive), Server); + this.OnReceive, Server); } catch (Exception e) { @@ -457,7 +459,7 @@ private void ProcessReply(byte[] buffer) } Received = 0; - Server.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, new AsyncCallback(this.OnReadLast), Server); + Server.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, this.OnReadLast, Server); } /// @@ -482,7 +484,7 @@ private void OnReadLast(IAsyncResult ar) ProtocolComplete(null); else Server.BeginReceive(Buffer, Received, Buffer.Length - Received, SocketFlags.None, - new AsyncCallback(this.OnReadLast), Server); + this.OnReadLast, Server); } catch (Exception e) { diff --git a/src/Titanium.Web.Proxy/ProxySocket/SocksHandler.cs b/src/Titanium.Web.Proxy/ProxySocket/SocksHandler.cs index 19faa9894..0c41eff92 100644 --- a/src/Titanium.Web.Proxy/ProxySocket/SocksHandler.cs +++ b/src/Titanium.Web.Proxy/ProxySocket/SocksHandler.cs @@ -37,7 +37,7 @@ namespace Titanium.Web.Proxy.ProxySocket /// /// References the callback method to be called when the protocol negotiation is completed. /// - internal delegate void HandShakeComplete(Exception error); + internal delegate void HandShakeComplete(Exception? error); /// /// Implements a specific version of the SOCKS protocol. This is an abstract class; it must be inherited. @@ -56,6 +56,18 @@ public SocksHandler(Socket server, string user) Username = user; } + /// + /// Converts a port number to an array of bytes. + /// + /// The port to convert. + /// The buffer which contains the result data. + /// An array of two bytes that represents the specified port. + protected void PortToBytes(int port, Span buffer) + { + buffer[0] = (byte)(port / 256); + buffer[1] = (byte)(port % 256); + } + /// /// Converts a port number to an array of bytes. /// @@ -163,11 +175,7 @@ protected string Username /// Gets or sets the return value of the BeginConnect call. /// /// An IAsyncProxyResult object that is the return value of the BeginConnect call. - protected IAsyncProxyResult AsyncResult - { - get => _asyncResult; - set => _asyncResult = value; - } + protected IAsyncProxyResult AsyncResult { get; set; } /// /// Gets or sets a byte buffer. @@ -175,6 +183,11 @@ protected IAsyncProxyResult AsyncResult /// An array of bytes. protected byte[] Buffer { get; set; } + /// + /// Gets or sets actual data count in the buffer. + /// + protected int BufferCount { get; set; } + /// /// Gets or sets the number of bytes that have been received from the remote proxy server. /// @@ -188,9 +201,6 @@ protected IAsyncProxyResult AsyncResult /// Holds the value of the Username property. private string _username; - /// Holds the value of the AsyncResult property. - private IAsyncProxyResult _asyncResult; - /// Holds the address of the method to call when the SOCKS protocol has been completed. protected HandShakeComplete ProtocolComplete; @@ -213,9 +223,10 @@ protected IAsyncProxyResult AsyncResult /// An IPEndPoint that represents the remote device. /// The method to call when the connection has been established. /// The IPEndPoint of the SOCKS proxy server. + /// The state. /// An IAsyncProxyResult that references the asynchronous connection. public abstract IAsyncProxyResult BeginNegotiate(IPEndPoint remoteEP, HandShakeComplete callback, - IPEndPoint proxyEndPoint); + IPEndPoint proxyEndPoint, object state); /// /// Starts negotiating asynchronously with a SOCKS proxy server. @@ -224,8 +235,9 @@ public abstract IAsyncProxyResult BeginNegotiate(IPEndPoint remoteEP, HandShakeC /// The remote port to connect to. /// The method to call when the connection has been established. /// The IPEndPoint of the SOCKS proxy server. + /// The state. /// An IAsyncProxyResult that references the asynchronous connection. public abstract IAsyncProxyResult BeginNegotiate(string host, int port, HandShakeComplete callback, - IPEndPoint proxyEndPoint); + IPEndPoint proxyEndPoint, object state); } } From 8323f79f8130f885b7ce8a51655d32ee30d13e6b Mon Sep 17 00:00:00 2001 From: Honfika Date: Wed, 25 Dec 2019 19:53:05 +0100 Subject: [PATCH 05/10] socks5 refactored + small fies --- .../Network/Tcp/TcpConnectionFactory.cs | 69 +++--- .../ProxySocket/Authentication/AuthMethod.cs | 29 +-- .../ProxySocket/HttpsHandler.cs | 37 +-- .../ProxySocket/IAsyncProxyResult.cs | 53 +---- .../ProxySocket/ProxySocket.cs | 88 +++---- .../ProxySocket/Socks4Handler.cs | 24 +- .../ProxySocket/Socks5Handler.cs | 214 ++++++++++-------- .../ProxySocket/SocksHandler.cs | 32 ++- 8 files changed, 265 insertions(+), 281 deletions(-) diff --git a/src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs b/src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs index c22fa8506..a934994f1 100644 --- a/src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs +++ b/src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs @@ -395,40 +395,41 @@ private async Task createServerConnection(string remoteHost tcpServerSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); } - var connectTask = socks - ? ProxySocketConnectionTaskFactory.CreateTask((ProxySocket.ProxySocket)tcpServerSocket, ipAddress, port) - : SocketConnectionTaskFactory.CreateTask(tcpServerSocket, ipAddress, port); - - await Task.WhenAny(connectTask, Task.Delay(proxyServer.ConnectTimeOutSeconds * 1000, cancellationToken)); - if (!connectTask.IsCompleted || !tcpServerSocket.Connected) - { - // here we can just do some cleanup and let the loop continue since - // we will either get a connection or wind up with a null tcpClient - // which will throw - try - { - connectTask.Dispose(); - } - catch - { - // ignore - } - try - { -#if NET45 - tcpServerSocket?.Close(); -#else - tcpServerSocket?.Dispose(); -#endif - tcpServerSocket = null; - } - catch - { - // ignore - } - - continue; - } + ((ProxySocket.ProxySocket)tcpServerSocket).Connect(ipAddress, port); +// var connectTask = socks +// ? ProxySocketConnectionTaskFactory.CreateTask((ProxySocket.ProxySocket)tcpServerSocket, ipAddress, port) +// : SocketConnectionTaskFactory.CreateTask(tcpServerSocket, ipAddress, port); + +// await Task.WhenAny(connectTask, Task.Delay(proxyServer.ConnectTimeOutSeconds * 1000, cancellationToken)); +// if (!connectTask.IsCompleted || !tcpServerSocket.Connected) +// { +// // here we can just do some cleanup and let the loop continue since +// // we will either get a connection or wind up with a null tcpClient +// // which will throw +// try +// { +// connectTask.Dispose(); +// } +// catch +// { +// // ignore +// } +// try +// { +//#if NET45 +// tcpServerSocket?.Close(); +//#else +// tcpServerSocket?.Dispose(); +//#endif +// tcpServerSocket = null; +// } +// catch +// { +// // ignore +// } + +// continue; +// } break; } diff --git a/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthMethod.cs b/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthMethod.cs index 4ead58437..23659deff 100644 --- a/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthMethod.cs +++ b/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthMethod.cs @@ -90,45 +90,20 @@ protected Socket Server /// Gets or sets a byt array that can be used to store data. /// /// A byte array to store data. - protected byte[] Buffer - { - get - { - return _buffer; - } - set - { - _buffer = value; - } - } + protected byte[] Buffer { get; set; } /// /// Gets or sets the number of bytes that have been received from the remote proxy server. /// /// An integer that holds the number of bytes that have been received from the remote proxy server. - protected int Received - { - get - { - return _received; - } - set - { - _received = value; - } - } + protected int Received { get; set; } // private variables - /// Holds the value of the Buffer property. - private byte[] _buffer; /// Holds the value of the Server property. private Socket _server; /// Holds the address of the method to call when the proxy has authenticated the client. protected HandShakeComplete CallBack; - - /// Holds the value of the Received property. - private int _received; } } diff --git a/src/Titanium.Web.Proxy/ProxySocket/HttpsHandler.cs b/src/Titanium.Web.Proxy/ProxySocket/HttpsHandler.cs index 88df5e4f7..610a84fa9 100644 --- a/src/Titanium.Web.Proxy/ProxySocket/HttpsHandler.cs +++ b/src/Titanium.Web.Proxy/ProxySocket/HttpsHandler.cs @@ -73,7 +73,7 @@ public HttpsHandler(Socket server, string user, string pass) : base(server, user /// An array of bytes that has to be sent when the user wants to connect to a specific IPEndPoint. private byte[] GetConnectBytes(string host, int port) { - StringBuilder sb = new StringBuilder(); + var sb = new StringBuilder(); sb.AppendLine(string.Format("CONNECT {0}:{1} HTTP/1.1", host, port)); sb.AppendLine(string.Format("Host: {0}:{1}", host, port)); if (!string.IsNullOrEmpty(Username)) @@ -92,12 +92,14 @@ private byte[] GetConnectBytes(string host, int port) /// Verifies that proxy server successfully connected to requested host /// /// Input data array - private void VerifyConnectHeader(byte[] buffer) + /// The data count in the buffer + private void VerifyConnectHeader(byte[] buffer, int length) { - string header = Encoding.ASCII.GetString(buffer); + string header = Encoding.ASCII.GetString(buffer, 0, length); if ((!header.StartsWith("HTTP/1.1 ", StringComparison.OrdinalIgnoreCase) && !header.StartsWith("HTTP/1.0 ", StringComparison.OrdinalIgnoreCase)) || !header.EndsWith(" ")) throw new ProtocolViolationException(); + string code = header.Substring(9, 3); if (code != "200") throw new ProxyException("Invalid HTTP status. Code: " + code); @@ -134,20 +136,21 @@ public override void Negotiate(string host, int port) { if (host == null) throw new ArgumentNullException(); + if (port <= 0 || port > 65535 || host.Length > 255) throw new ArgumentException(); + byte[] buffer = GetConnectBytes(host, port); if (Server.Send(buffer, 0, buffer.Length, SocketFlags.None) < buffer.Length) { throw new SocketException(10054); } - buffer = ReadBytes(13); - VerifyConnectHeader(buffer); + ReadBytes(buffer, 13); // buffer is always longer than 13 bytes. Check the code in GetConnectBytes + VerifyConnectHeader(buffer, 13); // Read bytes 1 by 1 until we reach "\r\n\r\n" int receivedNewlineChars = 0; - buffer = new byte[1]; while (receivedNewlineChars < 4) { int recv = Server.Receive(buffer, 0, 1, SocketFlags.None); @@ -209,7 +212,7 @@ private void OnConnect(IAsyncResult ar) } catch (Exception e) { - ProtocolComplete(e); + OnProtocolComplete(e); return; } @@ -220,7 +223,7 @@ private void OnConnect(IAsyncResult ar) } catch (Exception e) { - ProtocolComplete(e); + OnProtocolComplete(e); } } @@ -239,7 +242,7 @@ private void OnConnectSent(IAsyncResult ar) } catch (Exception e) { - ProtocolComplete(e); + OnProtocolComplete(e); } } @@ -255,7 +258,7 @@ private void OnConnectReceive(IAsyncResult ar) } catch (Exception e) { - ProtocolComplete(e); + OnProtocolComplete(e); return; } @@ -268,13 +271,13 @@ private void OnConnectReceive(IAsyncResult ar) } else { - VerifyConnectHeader(Buffer); + VerifyConnectHeader(Buffer, 13); ReadUntilHeadersEnd(true); } } catch (Exception e) { - ProtocolComplete(e); + OnProtocolComplete(e); } } @@ -303,7 +306,7 @@ private void ReadUntilHeadersEnd(bool readFirstByte) if (_receivedNewlineChars == 4) { - ProtocolComplete(null); + OnProtocolComplete(null); } else { @@ -327,10 +330,16 @@ private void OnEndHeadersReceive(IAsyncResult ar) } catch (Exception e) { - ProtocolComplete(e); + OnProtocolComplete(e); } } + protected override void OnProtocolComplete(Exception? exception) + { + // do not return the base Buffer + ProtocolComplete(exception); + } + /// /// Gets or sets the password to use when authenticating with the HTTPS server. /// diff --git a/src/Titanium.Web.Proxy/ProxySocket/IAsyncProxyResult.cs b/src/Titanium.Web.Proxy/ProxySocket/IAsyncProxyResult.cs index 5d95ba3cc..99ecfea35 100644 --- a/src/Titanium.Web.Proxy/ProxySocket/IAsyncProxyResult.cs +++ b/src/Titanium.Web.Proxy/ProxySocket/IAsyncProxyResult.cs @@ -42,73 +42,40 @@ internal class IAsyncProxyResult : IAsyncResult /// An object that contains state information for this request. internal IAsyncProxyResult(object stateObject = null) { - _stateObject = stateObject; - _completed = false; - if (_waitHandle != null) - _waitHandle.Reset(); + AsyncState = stateObject; + IsCompleted = false; + _waitHandle?.Reset(); } /// Initializes the internal variables of this object internal void Reset() { - _stateObject = null; - _completed = true; - if (_waitHandle != null) - _waitHandle.Set(); + //AsyncState = null; + IsCompleted = true; + _waitHandle?.Set(); } /// Gets a value that indicates whether the server has completed processing the call. It is illegal for the server to use any client supplied resources outside of the agreed upon sharing semantics after it sets the IsCompleted property to "true". Thus, it is safe for the client to destroy the resources after IsCompleted property returns "true". /// A boolean that indicates whether the server has completed processing the call. - public bool IsCompleted - { - get - { - return _completed; - } - } + public bool IsCompleted { get; private set; } /// Gets a value that indicates whether the BeginXXXX call has been completed synchronously. If this is detected in the AsyncCallback delegate, it is probable that the thread that called BeginInvoke is the current thread. /// Returns false. - public bool CompletedSynchronously - { - get - { - return false; - } - } + public bool CompletedSynchronously => false; /// Gets an object that was passed as the state parameter of the BeginXXXX method call. /// The object that was passed as the state parameter of the BeginXXXX method call. - public object AsyncState - { - get - { - return _stateObject; - } - } + public object AsyncState { get; private set; } /// /// The AsyncWaitHandle property returns the WaitHandle that can use to perform a WaitHandle.WaitOne or WaitAny or WaitAll. The object which implements IAsyncResult need not derive from the System.WaitHandle classes directly. The WaitHandle wraps its underlying synchronization primitive and should be signaled after the call is completed. This enables the client to wait for the call to complete instead polling. The Runtime supplies a number of waitable objects that mirror Win32 synchronization primitives e.g. ManualResetEvent, AutoResetEvent and Mutex. /// WaitHandle supplies methods that support waiting for such synchronization objects to become signaled with "any" or "all" semantics i.e. WaitHandle.WaitOne, WaitAny and WaitAll. Such methods are context aware to avoid deadlocks. The AsyncWaitHandle can be allocated eagerly or on demand. It is the choice of the IAsyncResult implementer. /// /// The WaitHandle associated with this asynchronous result. - public WaitHandle AsyncWaitHandle - { - get - { - if (_waitHandle == null) - _waitHandle = new ManualResetEvent(false); - return _waitHandle; - } - } + public WaitHandle AsyncWaitHandle => _waitHandle ??= new ManualResetEvent(false); // private variables - /// Used internally to represent the state of the asynchronous request - private bool _completed; - - /// Holds the value of the StateObject property. - private object _stateObject; /// Holds the value of the WaitHandle property. private ManualResetEvent _waitHandle; diff --git a/src/Titanium.Web.Proxy/ProxySocket/ProxySocket.cs b/src/Titanium.Web.Proxy/ProxySocket/ProxySocket.cs index 4dfed60de..ebc620482 100644 --- a/src/Titanium.Web.Proxy/ProxySocket/ProxySocket.cs +++ b/src/Titanium.Web.Proxy/ProxySocket/ProxySocket.cs @@ -31,7 +31,6 @@ OF THE POSSIBILITY OF SUCH DAMAGE. using System; using System.Net; using System.Net.Sockets; -using System.Security.AccessControl; // Implements a number of classes to allow Sockets to connect trough a firewall. namespace Titanium.Web.Proxy.ProxySocket @@ -104,6 +103,21 @@ public ProxySocket(AddressFamily addressFamily, SocketType socketType, ProtocolT ToThrow = new InvalidOperationException(); } + /// + /// Establishes a connection to a remote device. + /// + /// An EndPoint address that represents the remote device. + /// An EndPoint port that represents the remote device. + /// The remoteEP parameter is a null reference (Nothing in Visual Basic). + /// An operating system error occurs while accessing the Socket. + /// The Socket has been closed. + /// An error occurred while talking to the proxy server. + public new void Connect(IPAddress address, int port) + { + var remoteEP = new IPEndPoint(address, port); + Connect(remoteEP); + } + /// /// Establishes a connection to a remote device. /// @@ -144,20 +158,22 @@ public ProxySocket(AddressFamily addressFamily, SocketType socketType, ProtocolT public new void Connect(string host, int port) { if (host == null) - throw new ArgumentNullException(" cannot be null."); + throw new ArgumentNullException(nameof(host)); + if (port <= 0 || port > 65535) - throw new ArgumentException("Invalid port."); + throw new ArgumentException(nameof(port)); + if (this.ProtocolType != ProtocolType.Tcp || ProxyType == ProxyTypes.None || ProxyEndPoint == null) base.Connect(new IPEndPoint(Dns.GetHostEntry(host).AddressList[0], port)); else { base.Connect(ProxyEndPoint); if (ProxyType == ProxyTypes.Https) - (new HttpsHandler(this, ProxyUser, ProxyPass)).Negotiate(host, port); + new HttpsHandler(this, ProxyUser, ProxyPass).Negotiate(host, port); else if (ProxyType == ProxyTypes.Socks4) - (new Socks4Handler(this, ProxyUser)).Negotiate(host, port); + new Socks4Handler(this, ProxyUser).Negotiate(host, port); else if (ProxyType == ProxyTypes.Socks5) - (new Socks5Handler(this, ProxyUser, ProxyPass)).Negotiate(host, port); + new Socks5Handler(this, ProxyUser, ProxyPass).Negotiate(host, port); } } @@ -248,31 +264,29 @@ public ProxySocket(AddressFamily addressFamily, SocketType socketType, ProtocolT AsyncResult = BeginDns(host, this.OnHandShakeComplete, state); return AsyncResult; } - else + + if (ProxyType == ProxyTypes.Https) { - if (ProxyType == ProxyTypes.Https) - { - AsyncResult = (new HttpsHandler(this, ProxyUser, ProxyPass)).BeginNegotiate(host, port, - this.OnHandShakeComplete, ProxyEndPoint, state); - return AsyncResult; - } - - if (ProxyType == ProxyTypes.Socks4) - { - AsyncResult = (new Socks4Handler(this, ProxyUser)).BeginNegotiate(host, port, - this.OnHandShakeComplete, ProxyEndPoint, state); - return AsyncResult; - } - - if (ProxyType == ProxyTypes.Socks5) - { - AsyncResult = (new Socks5Handler(this, ProxyUser, ProxyPass)).BeginNegotiate(host, port, - this.OnHandShakeComplete, ProxyEndPoint, state); - return AsyncResult; - } - - return null; + AsyncResult = (new HttpsHandler(this, ProxyUser, ProxyPass)).BeginNegotiate(host, port, + this.OnHandShakeComplete, ProxyEndPoint, state); + return AsyncResult; } + + if (ProxyType == ProxyTypes.Socks4) + { + AsyncResult = (new Socks4Handler(this, ProxyUser)).BeginNegotiate(host, port, + this.OnHandShakeComplete, ProxyEndPoint, state); + return AsyncResult; + } + + if (ProxyType == ProxyTypes.Socks5) + { + AsyncResult = (new Socks5Handler(this, ProxyUser, ProxyPass)).BeginNegotiate(host, port, + this.OnHandShakeComplete, ProxyEndPoint, state); + return AsyncResult; + } + + return null; } /// @@ -369,8 +383,8 @@ private void OnHandShakeComplete(Exception? error) this.Close(); ToThrow = error; - CallBack?.Invoke(AsyncResult); AsyncResult.Reset(); + CallBack?.Invoke(AsyncResult); } /// @@ -389,17 +403,7 @@ private void OnHandShakeComplete(Exception? error) /// Gets or sets a user-defined object. /// /// The user-defined object. - private object State - { - get - { - return _state; - } - set - { - _state = value; - } - } + private object State { get; set; } /// /// Gets or sets the username to use when authenticating with the proxy. @@ -442,8 +446,6 @@ public string ProxyPass private int RemotePort { get; set; } // private variables - /// Holds the value of the State property. - private object _state; /// Holds the value of the ProxyUser property. private string _proxyUser = string.Empty; diff --git a/src/Titanium.Web.Proxy/ProxySocket/Socks4Handler.cs b/src/Titanium.Web.Proxy/ProxySocket/Socks4Handler.cs index 6e39b0f50..7c7f48fbf 100644 --- a/src/Titanium.Web.Proxy/ProxySocket/Socks4Handler.cs +++ b/src/Titanium.Web.Proxy/ProxySocket/Socks4Handler.cs @@ -169,14 +169,17 @@ public override void Negotiate(IPEndPoint remoteEP) /// The Socket has been closed. private void Negotiate(byte[] connect, int length) { - if (connect.Length < 2) - throw new ArgumentException(); + if (connect == null) + throw new ArgumentNullException(nameof(connect)); - if (Server.Send(connect, 0, length, SocketFlags.None) < connect.Length) + if (length < 2) + throw new ArgumentException(nameof(length)); + + if (Server.Send(connect, 0, length, SocketFlags.None) < length) throw new SocketException(10054); - byte[] buffer = ReadBytes(8); - if (buffer[1] != 90) + ReadBytes(connect, 8); + if (connect[1] != 90) { Server.Close(); throw new ProxyException("Negotiation failed."); @@ -266,8 +269,9 @@ private void OnSent(IAsyncResult ar) try { + BufferCount = 8; Received = 0; - Server.BeginReceive(Buffer, 0, 8, SocketFlags.None, OnReceive, Server); + Server.BeginReceive(Buffer, 0, BufferCount, SocketFlags.None, OnReceive, Server); } catch (Exception e) { @@ -296,7 +300,7 @@ private void OnReceive(IAsyncResult ar) } else { - Server.BeginReceive(Buffer, Received, Buffer.Length - Received, SocketFlags.None, OnReceive, + Server.BeginReceive(Buffer, Received, BufferCount - Received, SocketFlags.None, OnReceive, Server); } } @@ -305,11 +309,5 @@ private void OnReceive(IAsyncResult ar) OnProtocolComplete(e); } } - - private void OnProtocolComplete(Exception? exception) - { - ArrayPool.Shared.Return(Buffer); - ProtocolComplete(exception); - } } } diff --git a/src/Titanium.Web.Proxy/ProxySocket/Socks5Handler.cs b/src/Titanium.Web.Proxy/ProxySocket/Socks5Handler.cs index 135809581..831ecda3a 100644 --- a/src/Titanium.Web.Proxy/ProxySocket/Socks5Handler.cs +++ b/src/Titanium.Web.Proxy/ProxySocket/Socks5Handler.cs @@ -29,6 +29,7 @@ OF THE POSSIBILITY OF SUCH DAMAGE. */ using System; +using System.Buffers; using System.Net; using System.Net.Sockets; using System.Text; @@ -41,6 +42,8 @@ namespace Titanium.Web.Proxy.ProxySocket /// internal sealed class Socks5Handler : SocksHandler { + private const int ConnectOffset = 4; + /// /// Initializes a new Socks5Handler instance. /// @@ -75,13 +78,19 @@ public Socks5Handler(Socket server, string user, string pass) : base(server, use /// The proxy server uses an invalid protocol. /// An operating system error occurs while accessing the Socket. /// The Socket has been closed. - private void Authenticate() + private void Authenticate(byte[] buffer) { - if (Server.Send(new byte[] { 5, 2, 0, 2 }) < 4) + buffer[0] = 5; + buffer[1] = 2; + buffer[2] = 0; + buffer[3] = 2; + if (Server.Send(buffer, 0, 4, SocketFlags.None) < 4) throw new SocketException(10054); - byte[] buffer = ReadBytes(2); + + ReadBytes(buffer, 2); if (buffer[1] == 255) throw new ProxyException("No authentication method accepted."); + AuthMethod authenticate; switch (buffer[1]) { @@ -103,44 +112,56 @@ private void Authenticate() /// /// The host to connect to. /// The port to connect to. + /// The buffer which contains the result data. /// An array of bytes that has to be sent when the user wants to connect to a specific host/port combination. /// host is null. /// port or host is invalid. - private byte[] GetHostPortBytes(string host, int port) + private int GetHostPortBytes(string host, int port, Memory buffer) { if (host == null) throw new ArgumentNullException(); + if (port <= 0 || port > 65535 || host.Length > 255) throw new ArgumentException(); - byte[] connect = new byte[7 + host.Length]; + + int length = 7 + host.Length; + if (buffer.Length < length) + throw new ArgumentException(nameof(buffer)); + + var connect = buffer.Span; connect[0] = 5; connect[1] = 1; - connect[2] = 0; //reserved + connect[2] = 0; // reserved connect[3] = 3; connect[4] = (byte)host.Length; - Array.Copy(Encoding.ASCII.GetBytes(host), 0, connect, 5, host.Length); - Array.Copy(PortToBytes(port), 0, connect, host.Length + 5, 2); - return connect; + Encoding.ASCII.GetBytes(host).CopyTo(connect.Slice(5)); + PortToBytes(port, connect.Slice(host.Length + 5)); + return length; } /// /// Creates an array of bytes that has to be sent when the user wants to connect to a specific IPEndPoint. /// /// The IPEndPoint to connect to. + /// The buffer which contains the result data. /// An array of bytes that has to be sent when the user wants to connect to a specific IPEndPoint. /// remoteEP is null. - private byte[] GetEndPointBytes(IPEndPoint remoteEP) + private int GetEndPointBytes(IPEndPoint remoteEP, Memory buffer) { if (remoteEP == null) throw new ArgumentNullException(); - byte[] connect = new byte[10]; + + if (buffer.Length < 10) + throw new ArgumentException(nameof(buffer)); + + var connect = buffer.Span; connect[0] = 5; connect[1] = 1; - connect[2] = 0; //reserved + connect[2] = 0; // reserved connect[3] = 1; - Array.Copy(remoteEP.Address.GetAddressBytes(), 0, connect, 4, 4); - Array.Copy(PortToBytes(remoteEP.Port), 0, connect, 8, 2); - return connect; + remoteEP.Address.GetAddressBytes().CopyTo(connect.Slice(4)); + PortToBytes(remoteEP.Port, connect.Slice(8)); + return 10; } /// @@ -156,7 +177,18 @@ private byte[] GetEndPointBytes(IPEndPoint remoteEP) /// The proxy server uses an invalid protocol. public override void Negotiate(string host, int port) { - Negotiate(GetHostPortBytes(host, port)); + var buffer = ArrayPool.Shared.Rent(1024); + try + { + Authenticate(buffer); + + int length = GetHostPortBytes(host, port, buffer); + Negotiate(buffer, length); + } + finally + { + ArrayPool.Shared.Return(buffer); + } } /// @@ -170,25 +202,37 @@ public override void Negotiate(string host, int port) /// The proxy server uses an invalid protocol. public override void Negotiate(IPEndPoint remoteEP) { - Negotiate(GetEndPointBytes(remoteEP)); + var buffer = ArrayPool.Shared.Rent(1024); + try + { + Authenticate(buffer); + + int length = GetEndPointBytes(remoteEP, buffer); + Negotiate(buffer, length); + } + finally + { + ArrayPool.Shared.Return(buffer); + } } /// /// Starts negotiating with the SOCKS server. /// - /// The bytes to send when trying to authenticate. + /// The bytes to send when trying to authenticate. + /// The byte count to send when trying to authenticate. /// connect is null. /// connect is too small. /// The proxy rejected the request. /// An operating system error occurs while accessing the Socket. /// The Socket has been closed. /// The proxy server uses an invalid protocol. - private void Negotiate(byte[] connect) + private void Negotiate(byte[] buffer, int length) { - Authenticate(); - if (Server.Send(connect) < connect.Length) + if (Server.Send(buffer, 0, length, SocketFlags.None) < length) throw new SocketException(10054); - byte[] buffer = ReadBytes(4); + + ReadBytes(buffer, 4); if (buffer[1] != 0) { Server.Close(); @@ -198,14 +242,14 @@ private void Negotiate(byte[] connect) switch (buffer[3]) { case 1: - buffer = ReadBytes(6); //IPv4 address with port + ReadBytes(buffer, 6); // IPv4 address with port break; case 3: - buffer = ReadBytes(1); - buffer = ReadBytes(buffer[0] + 2); //domain name with port + ReadBytes(buffer, 1); // domain name length + ReadBytes(buffer, buffer[0] + 2); // domain name with port break; case 4: - buffer = ReadBytes(18); //IPv6 address with port + ReadBytes(buffer, 18); //IPv6 address with port break; default: Server.Close(); @@ -226,7 +270,10 @@ public override IAsyncProxyResult BeginNegotiate(string host, int port, HandShak IPEndPoint proxyEndPoint, object state) { ProtocolComplete = callback; - HandShake = GetHostPortBytes(host, port); + Buffer = ArrayPool.Shared.Rent(1024); + + // first {ConnectOffset} bytes are reserved for authentication + _handShakeLength = GetHostPortBytes(host, port, Buffer.AsMemory(ConnectOffset)); Server.BeginConnect(proxyEndPoint, this.OnConnect, Server); AsyncResult = new IAsyncProxyResult(state); return AsyncResult; @@ -244,7 +291,10 @@ public override IAsyncProxyResult BeginNegotiate(IPEndPoint remoteEP, HandShakeC IPEndPoint proxyEndPoint, object state) { ProtocolComplete = callback; - HandShake = GetEndPointBytes(remoteEP); + Buffer = ArrayPool.Shared.Rent(1024); + + // first {ConnectOffset} bytes are reserved for authentication + _handShakeLength = GetEndPointBytes(remoteEP, Buffer.AsMemory(ConnectOffset)); Server.BeginConnect(proxyEndPoint, this.OnConnect, Server); AsyncResult = new IAsyncProxyResult(state); return AsyncResult; @@ -262,18 +312,22 @@ private void OnConnect(IAsyncResult ar) } catch (Exception e) { - ProtocolComplete(e); + OnProtocolComplete(e); return; } try { - Server.BeginSend(new byte[] { 5, 2, 0, 2 }, 0, 4, SocketFlags.None, this.OnAuthSent, + Buffer[0] = 5; + Buffer[1] = 2; + Buffer[2] = 0; + Buffer[3] = 2; + Server.BeginSend(Buffer, 0, 4, SocketFlags.None, this.OnAuthSent, Server); } catch (Exception e) { - ProtocolComplete(e); + OnProtocolComplete(e); } } @@ -289,20 +343,20 @@ private void OnAuthSent(IAsyncResult ar) } catch (Exception e) { - ProtocolComplete(e); + OnProtocolComplete(e); return; } try { - Buffer = new byte[1024]; + BufferCount = 2; Received = 0; - Server.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, this.OnAuthReceive, + Server.BeginReceive(Buffer, 0, BufferCount, SocketFlags.None, this.OnAuthReceive, Server); } catch (Exception e) { - ProtocolComplete(e); + OnProtocolComplete(e); } } @@ -318,15 +372,15 @@ private void OnAuthReceive(IAsyncResult ar) } catch (Exception e) { - ProtocolComplete(e); + OnProtocolComplete(e); return; } try { - if (Received < 2) + if (Received < BufferCount) { - Server.BeginReceive(Buffer, Received, Buffer.Length - Received, SocketFlags.None, + Server.BeginReceive(Buffer, Received, BufferCount - Received, SocketFlags.None, this.OnAuthReceive, Server); } else @@ -341,7 +395,7 @@ private void OnAuthReceive(IAsyncResult ar) authenticate = new AuthUserPass(Server, Username, Password); break; default: - ProtocolComplete(new SocketException()); + OnProtocolComplete(new SocketException()); return; } @@ -350,7 +404,7 @@ private void OnAuthReceive(IAsyncResult ar) } catch (Exception e) { - ProtocolComplete(e); + OnProtocolComplete(e); } } @@ -362,18 +416,18 @@ private void OnAuthenticated(Exception e) { if (e != null) { - ProtocolComplete(e); + OnProtocolComplete(e); return; } try { - Server.BeginSend(HandShake, 0, HandShake.Length, SocketFlags.None, this.OnSent, + Server.BeginSend(Buffer, ConnectOffset, _handShakeLength, SocketFlags.None, this.OnSent, Server); } catch (Exception ex) { - ProtocolComplete(ex); + OnProtocolComplete(ex); } } @@ -385,24 +439,24 @@ private void OnSent(IAsyncResult ar) { try { - HandleEndSend(ar, HandShake.Length); + HandleEndSend(ar, BufferCount - ConnectOffset); } catch (Exception e) { - ProtocolComplete(e); + OnProtocolComplete(e); return; } try { - Buffer = new byte[5]; + BufferCount = 5; Received = 0; - Server.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, this.OnReceive, + Server.BeginReceive(Buffer, 0, BufferCount, SocketFlags.None, this.OnReceive, Server); } catch (Exception e) { - ProtocolComplete(e); + OnProtocolComplete(e); } } @@ -418,21 +472,21 @@ private void OnReceive(IAsyncResult ar) } catch (Exception e) { - ProtocolComplete(e); + OnProtocolComplete(e); return; } try { - if (Received == Buffer.Length) + if (Received == BufferCount) ProcessReply(Buffer); else - Server.BeginReceive(Buffer, Received, Buffer.Length - Received, SocketFlags.None, + Server.BeginReceive(Buffer, Received, BufferCount - Received, SocketFlags.None, this.OnReceive, Server); } catch (Exception e) { - ProtocolComplete(e); + OnProtocolComplete(e); } } @@ -443,23 +497,25 @@ private void OnReceive(IAsyncResult ar) /// The received reply is invalid. private void ProcessReply(byte[] buffer) { + int lengthToRead; switch (buffer[3]) { case 1: - Buffer = new byte[5]; //IPv4 address with port - 1 byte + lengthToRead = 5; //IPv4 address with port - 1 byte break; case 3: - Buffer = new byte[buffer[4] + 2]; //domain name with port + lengthToRead = buffer[4] + 2; //domain name with port break; case 4: - buffer = new byte[17]; //IPv6 address with port - 1 byte + lengthToRead = 17; //IPv6 address with port - 1 byte break; default: throw new ProtocolViolationException(); } Received = 0; - Server.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, this.OnReadLast, Server); + BufferCount = lengthToRead; + Server.BeginReceive(Buffer, 0, BufferCount, SocketFlags.None, this.OnReadLast, Server); } /// @@ -474,63 +530,41 @@ private void OnReadLast(IAsyncResult ar) } catch (Exception e) { - ProtocolComplete(e); + OnProtocolComplete(e); return; } try { - if (Received == Buffer.Length) - ProtocolComplete(null); + if (Received == BufferCount) + OnProtocolComplete(null); else - Server.BeginReceive(Buffer, Received, Buffer.Length - Received, SocketFlags.None, + Server.BeginReceive(Buffer, Received, BufferCount - Received, SocketFlags.None, this.OnReadLast, Server); } catch (Exception e) { - ProtocolComplete(e); + OnProtocolComplete(e); } } /// - /// Gets or sets the password to use when authenticating with the SOCKS5 server. + /// The length of the connect request. /// - /// The password to use when authenticating with the SOCKS5 server. - private string Password - { - get - { - return _password; - } - set - { - if (value == null) - throw new ArgumentNullException(); - _password = value; - } - } + private int _handShakeLength; /// - /// Gets or sets the bytes to use when sending a connect request to the proxy server. + /// Gets or sets the password to use when authenticating with the SOCKS5 server. /// - /// The array of bytes to use when sending a connect request to the proxy server. - private byte[] HandShake + /// The password to use when authenticating with the SOCKS5 server. + private string Password { - get - { - return _handShake; - } - set - { - _handShake = value; - } + get => _password; + set => _password = value ?? throw new ArgumentNullException(); } // private variables /// Holds the value of the Password property. private string _password; - - /// Holds the value of the HandShake property. - private byte[] _handShake; } } diff --git a/src/Titanium.Web.Proxy/ProxySocket/SocksHandler.cs b/src/Titanium.Web.Proxy/ProxySocket/SocksHandler.cs index 0c41eff92..edeef2264 100644 --- a/src/Titanium.Web.Proxy/ProxySocket/SocksHandler.cs +++ b/src/Titanium.Web.Proxy/ProxySocket/SocksHandler.cs @@ -29,6 +29,7 @@ OF THE POSSIBILITY OF SUCH DAMAGE. */ using System; +using System.Buffers; using System.Net; using System.Net.Sockets; @@ -68,19 +69,6 @@ protected void PortToBytes(int port, Span buffer) buffer[1] = (byte)(port % 256); } - /// - /// Converts a port number to an array of bytes. - /// - /// The port to convert. - /// An array of two bytes that represents the specified port. - protected byte[] PortToBytes(int port) - { - byte[] ret = new byte[2]; - ret[0] = (byte)(port / 256); - ret[1] = (byte)(port % 256); - return ret; - } - /// /// Converts an IP address to an array of bytes. /// @@ -99,16 +87,17 @@ protected byte[] AddressToBytes(long address) /// /// Reads a specified number of bytes from the Server socket. /// + /// The result buffer. /// The number of bytes to return. /// An array of bytes. /// The number of bytes to read is invalid. /// An operating system error occurs while accessing the Socket. /// The Socket has been closed. - protected byte[] ReadBytes(int count) + protected void ReadBytes(byte[] buffer, int count) { if (count <= 0) throw new ArgumentException(); - byte[] buffer = new byte[count]; + int received = 0; while (received != count) { @@ -120,8 +109,6 @@ protected byte[] ReadBytes(int count) received += recv; } - - return buffer; } /// @@ -134,6 +121,7 @@ protected void HandleEndReceive(IAsyncResult ar) int recv = Server.EndReceive(ar); if (recv <= 0) throw new SocketException(10054); + Received += recv; } @@ -149,6 +137,16 @@ protected void HandleEndSend(IAsyncResult ar, int expectedLength) throw new SocketException(10054); } + protected virtual void OnProtocolComplete(Exception? exception) + { + if (Buffer != null) + { + ArrayPool.Shared.Return(Buffer); + } + + ProtocolComplete(exception); + } + /// /// Gets or sets the socket connection with the proxy server. /// From 6d0d8f6d85cf2b3ae201343fd9ec97f6278acbc1 Mon Sep 17 00:00:00 2001 From: Honfika Date: Wed, 25 Dec 2019 19:54:28 +0100 Subject: [PATCH 06/10] fix --- .../Network/Tcp/TcpConnectionFactory.cs | 69 +++++++++---------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs b/src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs index a934994f1..e40f5b34b 100644 --- a/src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs +++ b/src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs @@ -395,41 +395,40 @@ private async Task createServerConnection(string remoteHost tcpServerSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); } - ((ProxySocket.ProxySocket)tcpServerSocket).Connect(ipAddress, port); -// var connectTask = socks -// ? ProxySocketConnectionTaskFactory.CreateTask((ProxySocket.ProxySocket)tcpServerSocket, ipAddress, port) -// : SocketConnectionTaskFactory.CreateTask(tcpServerSocket, ipAddress, port); - -// await Task.WhenAny(connectTask, Task.Delay(proxyServer.ConnectTimeOutSeconds * 1000, cancellationToken)); -// if (!connectTask.IsCompleted || !tcpServerSocket.Connected) -// { -// // here we can just do some cleanup and let the loop continue since -// // we will either get a connection or wind up with a null tcpClient -// // which will throw -// try -// { -// connectTask.Dispose(); -// } -// catch -// { -// // ignore -// } -// try -// { -//#if NET45 -// tcpServerSocket?.Close(); -//#else -// tcpServerSocket?.Dispose(); -//#endif -// tcpServerSocket = null; -// } -// catch -// { -// // ignore -// } - -// continue; -// } + var connectTask = socks + ? ProxySocketConnectionTaskFactory.CreateTask((ProxySocket.ProxySocket)tcpServerSocket, ipAddress, port) + : SocketConnectionTaskFactory.CreateTask(tcpServerSocket, ipAddress, port); + + await Task.WhenAny(connectTask, Task.Delay(proxyServer.ConnectTimeOutSeconds * 1000, cancellationToken)); + if (!connectTask.IsCompleted || !tcpServerSocket.Connected) + { + // here we can just do some cleanup and let the loop continue since + // we will either get a connection or wind up with a null tcpClient + // which will throw + try + { + connectTask.Dispose(); + } + catch + { + // ignore + } + try + { +#if NET45 + tcpServerSocket?.Close(); +#else + tcpServerSocket?.Dispose(); +#endif + tcpServerSocket = null; + } + catch + { + // ignore + } + + continue; + } break; } From 654720fd006127f41c2dfe6ad551824ffa5801f2 Mon Sep 17 00:00:00 2001 From: Honfika Date: Wed, 25 Dec 2019 21:20:20 +0100 Subject: [PATCH 07/10] smaller memor usage for socks connect --- .../ProxySocket/Authentication/AuthMethod.cs | 12 +-- .../Authentication/AuthUserPass.cs | 81 ++++++++++--------- .../ProxySocket/Socks4Handler.cs | 21 +++-- .../ProxySocket/Socks5Handler.cs | 10 +-- .../ProxySocket/SocksHandler.cs | 2 +- 5 files changed, 60 insertions(+), 66 deletions(-) diff --git a/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthMethod.cs b/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthMethod.cs index 23659deff..390662bb7 100644 --- a/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthMethod.cs +++ b/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthMethod.cs @@ -74,16 +74,8 @@ public AuthMethod(Socket server) /// The socket connection with the proxy server. protected Socket Server { - get - { - return _server; - } - set - { - if (value == null) - throw new ArgumentNullException(); - _server = value; - } + get => _server; + set => _server = value ?? throw new ArgumentNullException(); } /// diff --git a/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthUserPass.cs b/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthUserPass.cs index dbe547236..18983bf13 100644 --- a/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthUserPass.cs +++ b/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthUserPass.cs @@ -29,6 +29,7 @@ OF THE POSSIBILITY OF SUCH DAMAGE. */ using System; +using System.Buffers; using System.Net.Sockets; using System.Text; @@ -56,15 +57,14 @@ public AuthUserPass(Socket server, string user, string pass) : base(server) /// Creates an array of bytes that has to be sent if the user wants to authenticate with the username/password authentication scheme. /// /// An array of bytes that has to be sent if the user wants to authenticate with the username/password authentication scheme. - private byte[] GetAuthenticationBytes() + private void GetAuthenticationBytes(Memory buffer) { - byte[] buffer = new byte[3 + Username.Length + Password.Length]; - buffer[0] = 1; - buffer[1] = (byte)Username.Length; - Array.Copy(Encoding.ASCII.GetBytes(Username), 0, buffer, 2, Username.Length); - buffer[Username.Length + 2] = (byte)Password.Length; - Array.Copy(Encoding.ASCII.GetBytes(Password), 0, buffer, Username.Length + 3, Password.Length); - return buffer; + var span = buffer.Span; + span[0] = 1; + span[1] = (byte)Username.Length; + Encoding.ASCII.GetBytes(Username).CopyTo(span.Slice(2)); + span[Username.Length + 2] = (byte)Password.Length; + Encoding.ASCII.GetBytes(Password).CopyTo(span.Slice(Username.Length + 3)); } private int GetAuthenticationLength() @@ -77,19 +77,28 @@ private int GetAuthenticationLength() /// public override void Authenticate() { - if (Server.Send(GetAuthenticationBytes()) < GetAuthenticationLength()) + int length = GetAuthenticationLength(); + var buffer = ArrayPool.Shared.Rent(length); + try { - throw new SocketException(10054); + GetAuthenticationBytes(buffer); + if (Server.Send(buffer, 0, length, SocketFlags.None) < length) + { + throw new SocketException(10054); + } + } + finally + { + ArrayPool.Shared.Return(buffer); } - ; - byte[] buffer = new byte[2]; int received = 0; while (received != 2) { int recv = Server.Receive(buffer, received, 2 - received, SocketFlags.None); if (recv == 0) throw new SocketException(10054); + received += recv; } @@ -98,8 +107,6 @@ public override void Authenticate() Server.Close(); throw new ProxyException("Username/password combination rejected."); } - - return; } /// @@ -108,10 +115,11 @@ public override void Authenticate() /// The method to call when the authentication is complete. public override void BeginAuthenticate(HandShakeComplete callback) { + int length = GetAuthenticationLength(); + Buffer = ArrayPool.Shared.Rent(length); + GetAuthenticationBytes(Buffer); CallBack = callback; - Server.BeginSend(GetAuthenticationBytes(), 0, GetAuthenticationLength(), SocketFlags.None, - this.OnSent, Server); - return; + Server.BeginSend(Buffer, 0, length, SocketFlags.None, this.OnSent, Server); } /// @@ -124,12 +132,12 @@ private void OnSent(IAsyncResult ar) { if (Server.EndSend(ar) < GetAuthenticationLength()) throw new SocketException(10054); - Buffer = new byte[2]; + Server.BeginReceive(Buffer, 0, 2, SocketFlags.None, this.OnReceive, Server); } catch (Exception e) { - CallBack(e); + OnCallBack(e); } } @@ -144,22 +152,29 @@ private void OnReceive(IAsyncResult ar) int recv = Server.EndReceive(ar); if (recv <= 0) throw new SocketException(10054); + Received += recv; - if (Received == Buffer.Length) + if (Received == 2) if (Buffer[1] == 0) - CallBack(null); + OnCallBack(null); else throw new ProxyException("Username/password combination not accepted."); else - Server.BeginReceive(Buffer, Received, Buffer.Length - Received, SocketFlags.None, + Server.BeginReceive(Buffer, Received, 2 - Received, SocketFlags.None, this.OnReceive, Server); } catch (Exception e) { - CallBack(e); + OnCallBack(e); } } + private void OnCallBack(Exception? exception) + { + ArrayPool.Shared.Return(Buffer); + CallBack(exception); + } + /// /// Gets or sets the username to use when authenticating with the proxy server. /// @@ -167,14 +182,8 @@ private void OnReceive(IAsyncResult ar) /// The specified value is null. private string Username { - get - { - return _username; - } - set - { - _username = value ?? throw new ArgumentNullException(); - } + get => _username; + set => _username = value ?? throw new ArgumentNullException(); } /// @@ -184,14 +193,8 @@ private string Username /// The specified value is null. private string Password { - get - { - return _password; - } - set - { - _password = value ?? throw new ArgumentNullException(); - } + get => _password; + set => _password = value ?? throw new ArgumentNullException(); } // private variables diff --git a/src/Titanium.Web.Proxy/ProxySocket/Socks4Handler.cs b/src/Titanium.Web.Proxy/ProxySocket/Socks4Handler.cs index 7c7f48fbf..68ee6dc9c 100644 --- a/src/Titanium.Web.Proxy/ProxySocket/Socks4Handler.cs +++ b/src/Titanium.Web.Proxy/ProxySocket/Socks4Handler.cs @@ -30,6 +30,7 @@ OF THE POSSIBILITY OF SUCH DAMAGE. using System; using System.Buffers; +using System.Diagnostics; using System.Net; using System.Net.Sockets; using System.Text; @@ -68,8 +69,7 @@ private int GetHostPortBytes(string host, int port, Memory buffer) throw new ArgumentException(nameof(port)); int length = 10 + Username.Length + host.Length; - if (buffer.Length < length) - throw new ArgumentException(nameof(buffer)); + Debug.Assert(buffer.Length >= length); var connect = buffer.Span; connect[0] = 4; @@ -80,8 +80,8 @@ private int GetHostPortBytes(string host, int port, Memory buffer) var userNameArray = Encoding.ASCII.GetBytes(Username); userNameArray.CopyTo(connect.Slice(8)); connect[8 + Username.Length] = 0; - Encoding.ASCII.GetBytes(host).CopyTo(connect.Slice(9 + userNameArray.Length)); - connect[9 + Username.Length + host.Length] = 0; + Encoding.ASCII.GetBytes(host).CopyTo(connect.Slice(9 + Username.Length)); + connect[length - 1] = 0; return length; } @@ -98,8 +98,7 @@ private int GetEndPointBytes(IPEndPoint remoteEP, Memory buffer) throw new ArgumentNullException(nameof(remoteEP)); int length = 9 + Username.Length; - if (buffer.Length < length) - throw new ArgumentException(nameof(buffer)); + Debug.Assert(buffer.Length >= length); var connect = buffer.Span; connect[0] = 4; @@ -107,7 +106,7 @@ private int GetEndPointBytes(IPEndPoint remoteEP, Memory buffer) PortToBytes(remoteEP.Port, connect.Slice(2)); remoteEP.Address.GetAddressBytes().CopyTo(connect.Slice(4)); Encoding.ASCII.GetBytes(Username).CopyTo(connect.Slice(8)); - connect[8 + Username.Length] = 0; + connect[length - 1] = 0; return length; } @@ -123,7 +122,7 @@ private int GetEndPointBytes(IPEndPoint remoteEP, Memory buffer) /// The Socket has been closed. public override void Negotiate(string host, int port) { - var buffer = ArrayPool.Shared.Rent(1024); + var buffer = ArrayPool.Shared.Rent(10 + Username.Length + host.Length); try { int length = GetHostPortBytes(host, port, buffer); @@ -145,7 +144,7 @@ public override void Negotiate(string host, int port) /// The Socket has been closed. public override void Negotiate(IPEndPoint remoteEP) { - var buffer = ArrayPool.Shared.Rent(1024); + var buffer = ArrayPool.Shared.Rent(9 + Username.Length); try { int length = GetEndPointBytes(remoteEP, buffer); @@ -199,7 +198,7 @@ public override IAsyncProxyResult BeginNegotiate(string host, int port, HandShak IPEndPoint proxyEndPoint, object state) { ProtocolComplete = callback; - Buffer = ArrayPool.Shared.Rent(1024); + Buffer = ArrayPool.Shared.Rent(10 + Username.Length + host.Length); BufferCount = GetHostPortBytes(host, port, Buffer); Server.BeginConnect(proxyEndPoint, OnConnect, Server); AsyncResult = new IAsyncProxyResult(state); @@ -218,7 +217,7 @@ public override IAsyncProxyResult BeginNegotiate(IPEndPoint remoteEP, HandShakeC IPEndPoint proxyEndPoint, object state) { ProtocolComplete = callback; - Buffer = ArrayPool.Shared.Rent(1024); + Buffer = ArrayPool.Shared.Rent(9 + Username.Length); BufferCount = GetEndPointBytes(remoteEP, Buffer); Server.BeginConnect(proxyEndPoint, OnConnect, Server); AsyncResult = new IAsyncProxyResult(state); diff --git a/src/Titanium.Web.Proxy/ProxySocket/Socks5Handler.cs b/src/Titanium.Web.Proxy/ProxySocket/Socks5Handler.cs index 831ecda3a..65d228967 100644 --- a/src/Titanium.Web.Proxy/ProxySocket/Socks5Handler.cs +++ b/src/Titanium.Web.Proxy/ProxySocket/Socks5Handler.cs @@ -177,7 +177,7 @@ private int GetEndPointBytes(IPEndPoint remoteEP, Memory buffer) /// The proxy server uses an invalid protocol. public override void Negotiate(string host, int port) { - var buffer = ArrayPool.Shared.Rent(1024); + var buffer = ArrayPool.Shared.Rent(Math.Max(258, 10 + host.Length + Username.Length + Password.Length)); try { Authenticate(buffer); @@ -202,7 +202,7 @@ public override void Negotiate(string host, int port) /// The proxy server uses an invalid protocol. public override void Negotiate(IPEndPoint remoteEP) { - var buffer = ArrayPool.Shared.Rent(1024); + var buffer = ArrayPool.Shared.Rent(Math.Max(258, 13 + Username.Length + Password.Length)); try { Authenticate(buffer); @@ -270,7 +270,7 @@ public override IAsyncProxyResult BeginNegotiate(string host, int port, HandShak IPEndPoint proxyEndPoint, object state) { ProtocolComplete = callback; - Buffer = ArrayPool.Shared.Rent(1024); + Buffer = ArrayPool.Shared.Rent(Math.Max(258, 10 + host.Length + Username.Length + Password.Length)); // first {ConnectOffset} bytes are reserved for authentication _handShakeLength = GetHostPortBytes(host, port, Buffer.AsMemory(ConnectOffset)); @@ -291,7 +291,7 @@ public override IAsyncProxyResult BeginNegotiate(IPEndPoint remoteEP, HandShakeC IPEndPoint proxyEndPoint, object state) { ProtocolComplete = callback; - Buffer = ArrayPool.Shared.Rent(1024); + Buffer = ArrayPool.Shared.Rent(Math.Max(258, 13 + Username.Length + Password.Length)); // first {ConnectOffset} bytes are reserved for authentication _handShakeLength = GetEndPointBytes(remoteEP, Buffer.AsMemory(ConnectOffset)); @@ -565,6 +565,6 @@ private string Password // private variables /// Holds the value of the Password property. - private string _password; + private string _password = string.Empty; } } diff --git a/src/Titanium.Web.Proxy/ProxySocket/SocksHandler.cs b/src/Titanium.Web.Proxy/ProxySocket/SocksHandler.cs index edeef2264..10ee77785 100644 --- a/src/Titanium.Web.Proxy/ProxySocket/SocksHandler.cs +++ b/src/Titanium.Web.Proxy/ProxySocket/SocksHandler.cs @@ -197,7 +197,7 @@ protected string Username private Socket _server; /// Holds the value of the Username property. - private string _username; + private string _username = string.Empty; /// Holds the address of the method to call when the SOCKS protocol has been completed. protected HandShakeComplete ProtocolComplete; From fee760ee03da3245475ef4e90bab226daec1f31d Mon Sep 17 00:00:00 2001 From: Honfika Date: Wed, 25 Dec 2019 21:28:36 +0100 Subject: [PATCH 08/10] docfx upgrade --- .build/setup.ps1 | 2 +- src/Titanium.Web.Proxy/ExplicitClientHandler.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.build/setup.ps1 b/.build/setup.ps1 index efbdeb6b9..7bec77966 100644 --- a/.build/setup.ps1 +++ b/.build/setup.ps1 @@ -36,7 +36,7 @@ function Install-DocFx() { if(!(Test-Path $env:ChocolateyInstall\lib\docfx\tools*)) { - choco install docfx --version 2.40.1 + choco install docfx --version 2.47 } $env:Path += ";$env:ChocolateyInstall\lib\docfx\tools" } diff --git a/src/Titanium.Web.Proxy/ExplicitClientHandler.cs b/src/Titanium.Web.Proxy/ExplicitClientHandler.cs index e023ffae4..cff2b5a61 100644 --- a/src/Titanium.Web.Proxy/ExplicitClientHandler.cs +++ b/src/Titanium.Web.Proxy/ExplicitClientHandler.cs @@ -262,7 +262,7 @@ private async Task handleClient(ExplicitProxyEndPoint endPoint, TcpClientConnect } if (method == KnownMethod.Invalid) - { + { sendRawData = true; } From d99d541e3d43046cef3608d6245d753ea4ac70ab Mon Sep 17 00:00:00 2001 From: Honfika Date: Wed, 25 Dec 2019 21:30:18 +0100 Subject: [PATCH 09/10] fix --- src/Titanium.Web.Proxy/ExplicitClientHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Titanium.Web.Proxy/ExplicitClientHandler.cs b/src/Titanium.Web.Proxy/ExplicitClientHandler.cs index cff2b5a61..e023ffae4 100644 --- a/src/Titanium.Web.Proxy/ExplicitClientHandler.cs +++ b/src/Titanium.Web.Proxy/ExplicitClientHandler.cs @@ -262,7 +262,7 @@ private async Task handleClient(ExplicitProxyEndPoint endPoint, TcpClientConnect } if (method == KnownMethod.Invalid) - { + { sendRawData = true; } From 035e66d3fd5e78b63671e0d0118a2bc08784d521 Mon Sep 17 00:00:00 2001 From: buildbot121 Date: Wed, 25 Dec 2019 20:31:02 +0000 Subject: [PATCH 10/10] API documentation update by build server --- ...xy.EventArguments.AsyncEventHandler-1.html | 2 +- ...uments.BeforeSslAuthenticateEventArgs.html | 42 +- ...guments.CertificateSelectionEventArgs.html | 116 ++-- ...uments.CertificateValidationEventArgs.html | 122 +++- ...nts.MultipartRequestPartSentEventArgs.html | 71 +- ...Proxy.EventArguments.SessionEventArgs.html | 153 ++--- ...y.EventArguments.SessionEventArgsBase.html | 319 ++++++--- ...guments.TunnelConnectSessionEventArgs.html | 54 +- .../Titanium.Web.Proxy.EventArguments.html | 2 +- .../Titanium.Web.Proxy.ExceptionHandler.html | 2 +- ...roxy.Exceptions.BodyNotFoundException.html | 32 +- ...xceptions.ProxyAuthorizationException.html | 32 +- ...roxy.Exceptions.ProxyConnectException.html | 32 +- ...m.Web.Proxy.Exceptions.ProxyException.html | 32 +- ...b.Proxy.Exceptions.ProxyHttpException.html | 32 +- ....Exceptions.ServerConnectionException.html | 32 +- docs/api/Titanium.Web.Proxy.Exceptions.html | 2 +- .../Titanium.Web.Proxy.Helpers.RunTime.html | 55 +- docs/api/Titanium.Web.Proxy.Helpers.html | 2 +- ...itanium.Web.Proxy.Http.ConnectRequest.html | 44 +- ...tanium.Web.Proxy.Http.ConnectResponse.html | 12 +- ...anium.Web.Proxy.Http.HeaderCollection.html | 82 ++- ...Titanium.Web.Proxy.Http.HttpWebClient.html | 30 +- .../Titanium.Web.Proxy.Http.KnownHeaders.html | 118 ++-- docs/api/Titanium.Web.Proxy.Http.Request.html | 71 +- ...um.Web.Proxy.Http.RequestResponseBase.html | 40 +- .../api/Titanium.Web.Proxy.Http.Response.html | 22 +- ....Proxy.Http.Responses.GenericResponse.html | 14 +- ...m.Web.Proxy.Http.Responses.OkResponse.html | 8 +- ...Proxy.Http.Responses.RedirectResponse.html | 8 +- .../Titanium.Web.Proxy.Http.Responses.html | 2 +- docs/api/Titanium.Web.Proxy.Http.html | 2 +- ...um.Web.Proxy.Http2.Hpack.DynamicTable.html | 32 +- ...Proxy.Http2.Hpack.HpackUtil.IndexType.html | 2 +- ...anium.Web.Proxy.Http2.Hpack.HpackUtil.html | 14 +- ....Web.Proxy.Http2.Hpack.HuffmanDecoder.html | 24 +- docs/api/Titanium.Web.Proxy.Http2.Hpack.html | 14 +- ...eb.Proxy.Models.ExplicitProxyEndPoint.html | 20 +- ...tanium.Web.Proxy.Models.ExternalProxy.html | 177 ++++- ...um.Web.Proxy.Models.ExternalProxyType.html | 162 +++++ .../Titanium.Web.Proxy.Models.HttpHeader.html | 128 +--- ...oxy.Models.ProxyAuthenticationContext.html | 14 +- ...roxy.Models.ProxyAuthenticationResult.html | 2 +- ...tanium.Web.Proxy.Models.ProxyEndPoint.html | 15 +- ...um.Web.Proxy.Models.ProxyProtocolType.html | 2 +- ...Proxy.Models.TransparentProxyEndPoint.html | 53 +- docs/api/Titanium.Web.Proxy.Models.html | 4 +- ...m.Web.Proxy.Network.CertificateEngine.html | 2 +- ....Web.Proxy.Network.CertificateManager.html | 64 +- docs/api/Titanium.Web.Proxy.Network.html | 2 +- docs/api/Titanium.Web.Proxy.ProxyServer.html | 207 ++++-- docs/api/Titanium.Web.Proxy.html | 2 +- docs/api/toc.html | 19 +- docs/index.json | 106 ++- docs/styles/docfx.css | 7 +- docs/styles/docfx.js | 58 +- docs/styles/docfx.vendor.js | 15 +- docs/styles/lunr.min.js | 2 +- docs/styles/search-worker.js | 2 +- docs/xrefmap.yml | 628 ++++++++---------- 60 files changed, 1892 insertions(+), 1472 deletions(-) create mode 100644 docs/api/Titanium.Web.Proxy.Models.ExternalProxyType.html diff --git a/docs/api/Titanium.Web.Proxy.EventArguments.AsyncEventHandler-1.html b/docs/api/Titanium.Web.Proxy.EventArguments.AsyncEventHandler-1.html index 44b42b65a..a870d14cd 100644 --- a/docs/api/Titanium.Web.Proxy.EventArguments.AsyncEventHandler-1.html +++ b/docs/api/Titanium.Web.Proxy.EventArguments.AsyncEventHandler-1.html @@ -10,7 +10,7 @@ - + diff --git a/docs/api/Titanium.Web.Proxy.EventArguments.BeforeSslAuthenticateEventArgs.html b/docs/api/Titanium.Web.Proxy.EventArguments.BeforeSslAuthenticateEventArgs.html index ce36475a7..bb7aeecbc 100644 --- a/docs/api/Titanium.Web.Proxy.EventArguments.BeforeSslAuthenticateEventArgs.html +++ b/docs/api/Titanium.Web.Proxy.EventArguments.BeforeSslAuthenticateEventArgs.html @@ -10,7 +10,7 @@ - + @@ -89,41 +89,13 @@

Inheritance
Object
-
EventArgs
-
BeforeSslAuthenticateEventArgs
- -
-
Inherited Members
-
- EventArgs.Empty -
-
- Object.Equals(Object) -
-
- Object.Equals(Object, Object) -
-
- Object.GetHashCode() -
-
- Object.GetType() -
-
- Object.MemberwiseClone() -
-
- Object.ReferenceEquals(Object, Object) -
-
- Object.ToString() -
+
BeforeSslAuthenticateEventArgs
Namespace: Titanium.Web.Proxy.EventArguments
Assembly: Titanium.Web.Proxy.dll
Syntax
-
public class BeforeSslAuthenticateEventArgs : EventArgs
+
public class BeforeSslAuthenticateEventArgs : ProxyEventArgsBase

Properties

@@ -132,7 +104,7 @@

Properties Improve this Doc - View Source + View Source

DecryptSsl

@@ -165,7 +137,7 @@
Property Value
Improve this Doc - View Source + View Source

SniHostName

@@ -199,7 +171,7 @@

Methods Improve this Doc - View Source + View Source

TerminateSession()

@@ -221,7 +193,7 @@
Declaration
Improve this Doc
  • - View Source + View Source
  • diff --git a/docs/api/Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.html b/docs/api/Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.html index d91d76f01..b05b43464 100644 --- a/docs/api/Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.html +++ b/docs/api/Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.html @@ -10,7 +10,7 @@ - + @@ -89,42 +89,68 @@

    Inheritance
    Object
    -
    EventArgs
    -
    CertificateSelectionEventArgs
    - -
    -
    Inherited Members
    -
    - EventArgs.Empty -
    -
    - Object.Equals(Object) -
    -
    - Object.Equals(Object, Object) -
    -
    - Object.GetHashCode() -
    -
    - Object.GetType() -
    -
    - Object.MemberwiseClone() -
    -
    - Object.ReferenceEquals(Object, Object) -
    -
    - Object.ToString() -
    +
    CertificateSelectionEventArgs
    Namespace: Titanium.Web.Proxy.EventArguments
    Assembly: Titanium.Web.Proxy.dll
    Syntax
    -
    public class CertificateSelectionEventArgs : EventArgs
    +
    public class CertificateSelectionEventArgs : ProxyEventArgsBase
    +

    Constructors +

    + + | + Improve this Doc + + + View Source + + +

    CertificateSelectionEventArgs(SessionEventArgsBase, String, X509CertificateCollection, X509Certificate, String[])

    +
    +
    +
    Declaration
    +
    +
    public CertificateSelectionEventArgs(SessionEventArgsBase session, string targetHost, X509CertificateCollection localCertificates, X509Certificate remoteCertificate, string[] acceptableIssuers)
    +
    +
    Parameters
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeNameDescription
    SessionEventArgsBasesession
    StringtargetHost
    X509CertificateCollectionlocalCertificates
    X509CertificateremoteCertificate
    String[]acceptableIssuers

    Properties

    @@ -132,7 +158,7 @@

    Properties Improve this Doc - View Source + View Source

    AcceptableIssuers

    @@ -163,7 +189,7 @@
    Property Value
    Improve this Doc
    - View Source + View Source

    ClientCertificate

    @@ -194,7 +220,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    LocalCertificates

    @@ -225,7 +251,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    RemoteCertificate

    @@ -253,19 +279,18 @@
    Property Value
    | - Improve this Doc + Improve this Doc - View Source + View Source - -

    Sender

    -

    The proxy server instance.

    -
    + +

    Session

    +
    Declaration
    -
    public object Sender { get; }
    +
    public SessionEventArgsBase Session { get; }
    Property Value
    @@ -277,8 +302,9 @@
    Property Value
    - - + +
    ObjectSessionEventArgsBase

    The session.

    +
    @@ -287,7 +313,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    TargetHost

    diff --git a/docs/api/Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.html b/docs/api/Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.html index bbe2b1445..cf1d4016b 100644 --- a/docs/api/Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.html +++ b/docs/api/Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.html @@ -10,7 +10,7 @@ - + @@ -90,42 +90,63 @@

    Inheritance
    Object
    -
    EventArgs
    -
    CertificateValidationEventArgs
    - -
    -
    Inherited Members
    -
    - EventArgs.Empty -
    -
    - Object.Equals(Object) -
    -
    - Object.Equals(Object, Object) -
    -
    - Object.GetHashCode() -
    -
    - Object.GetType() -
    -
    - Object.MemberwiseClone() -
    -
    - Object.ReferenceEquals(Object, Object) -
    -
    - Object.ToString() -
    +
    CertificateValidationEventArgs
    Namespace: Titanium.Web.Proxy.EventArguments
    Assembly: Titanium.Web.Proxy.dll
    Syntax
    -
    public class CertificateValidationEventArgs : EventArgs
    +
    public class CertificateValidationEventArgs : ProxyEventArgsBase
    +

    Constructors +

    + + | + Improve this Doc + + + View Source + + +

    CertificateValidationEventArgs(SessionEventArgsBase, X509Certificate, X509Chain, SslPolicyErrors)

    +
    +
    +
    Declaration
    +
    +
    public CertificateValidationEventArgs(SessionEventArgsBase session, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
    +
    +
    Parameters
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeNameDescription
    SessionEventArgsBasesession
    X509Certificatecertificate
    X509Chainchain
    SslPolicyErrorssslPolicyErrors

    Properties

    @@ -133,7 +154,7 @@

    Properties Improve this Doc - View Source + View Source

    Certificate

    @@ -164,7 +185,7 @@
    Property Value
    Improve this Doc
    - View Source + View Source

    Chain

    @@ -195,7 +216,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    IsValid

    @@ -221,12 +242,43 @@
    Property Value
    + + | + Improve this Doc + + + View Source + + +

    Session

    +
    +
    +
    Declaration
    +
    +
    public SessionEventArgsBase Session { get; }
    +
    +
    Property Value
    + + + + + + + + + + + + + +
    TypeDescription
    SessionEventArgsBase

    The session.

    +
    | Improve this Doc - View Source + View Source

    SslPolicyErrors

    diff --git a/docs/api/Titanium.Web.Proxy.EventArguments.MultipartRequestPartSentEventArgs.html b/docs/api/Titanium.Web.Proxy.EventArguments.MultipartRequestPartSentEventArgs.html index 23f7e9105..d8d7ef64b 100644 --- a/docs/api/Titanium.Web.Proxy.EventArguments.MultipartRequestPartSentEventArgs.html +++ b/docs/api/Titanium.Web.Proxy.EventArguments.MultipartRequestPartSentEventArgs.html @@ -10,7 +10,7 @@ - + @@ -89,41 +89,13 @@

    Inheritance
    Object
    -
    EventArgs
    -
    MultipartRequestPartSentEventArgs
    - -
    -
    Inherited Members
    -
    - EventArgs.Empty -
    -
    - Object.Equals(Object) -
    -
    - Object.Equals(Object, Object) -
    -
    - Object.GetHashCode() -
    -
    - Object.GetType() -
    -
    - Object.MemberwiseClone() -
    -
    - Object.ReferenceEquals(Object, Object) -
    -
    - Object.ToString() -
    +
    MultipartRequestPartSentEventArgs
    Namespace: Titanium.Web.Proxy.EventArguments
    Assembly: Titanium.Web.Proxy.dll
    Syntax
    -
    public class MultipartRequestPartSentEventArgs : EventArgs
    +
    public class MultipartRequestPartSentEventArgs : ProxyEventArgsBase

    Properties

    @@ -132,7 +104,7 @@

    Properties Improve this Doc - View Source + View Source

    Boundary

    @@ -163,7 +135,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    Headers

    @@ -189,6 +161,37 @@
    Property Value
    + + | + Improve this Doc + + + View Source + + +

    Session

    +
    +
    +
    Declaration
    +
    +
    public SessionEventArgs Session { get; }
    +
    +
    Property Value
    + + + + + + + + + + + + + +
    TypeDescription
    SessionEventArgs

    The session arguments.

    +
    @@ -200,7 +203,7 @@
    Property Value
    Improve this Doc
  • - View Source + View Source
  • diff --git a/docs/api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html b/docs/api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html index 6f25c1bd9..ccb3ceb88 100644 --- a/docs/api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html +++ b/docs/api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html @@ -10,7 +10,7 @@ - + @@ -92,9 +92,8 @@

    Inheritance
    Object
    -
    EventArgs
    -
    SessionEventArgsBase
    -
    SessionEventArgs
    +
    SessionEventArgsBase
    +
    SessionEventArgs
    Implements
    @@ -102,6 +101,12 @@
    Implements
    Inherited Members
    +
    + SessionEventArgsBase.ClientConnectionId +
    +
    + SessionEventArgsBase.ServerConnectionId +
    SessionEventArgsBase.BufferPool
    @@ -114,9 +119,18 @@
    Inherited Members
    SessionEventArgsBase.UserData
    +
    + SessionEventArgsBase.EnableWinAuth +
    SessionEventArgsBase.IsHttps
    +
    + SessionEventArgsBase.ClientLocalEndPoint +
    +
    + SessionEventArgsBase.ClientRemoteEndPoint +
    SessionEventArgsBase.ClientEndPoint
    @@ -126,9 +140,15 @@
    Inherited Members
    SessionEventArgsBase.WebSession
    +
    + SessionEventArgsBase.CustomUpStreamProxy +
    SessionEventArgsBase.CustomUpStreamProxyUsed
    +
    + SessionEventArgsBase.ProxyEndPoint +
    SessionEventArgsBase.LocalEndPoint
    @@ -147,30 +167,6 @@
    Inherited Members
    SessionEventArgsBase.TerminateSession()
    -
    - EventArgs.Empty -
    -
    - Object.Equals(Object) -
    -
    - Object.Equals(Object, Object) -
    -
    - Object.GetHashCode() -
    -
    - Object.GetType() -
    -
    - Object.MemberwiseClone() -
    -
    - Object.ReferenceEquals(Object, Object) -
    -
    - Object.ToString() -
    Namespace: Titanium.Web.Proxy.EventArguments
    Assembly: Titanium.Web.Proxy.dll
    @@ -178,72 +174,54 @@
    Syntax
    public class SessionEventArgs : SessionEventArgsBase, IDisposable
    -

    Constructors +

    Properties

    | - Improve this Doc + Improve this Doc - View Source + View Source - -

    SessionEventArgs(ProxyServer, ProxyEndPoint, Request, CancellationTokenSource)

    -
    + +

    IsPromise

    +

    Is this session a HTTP/2 promise?

    +
    Declaration
    -
    protected SessionEventArgs(ProxyServer server, ProxyEndPoint endPoint, Request request, CancellationTokenSource cancellationTokenSource)
    +
    public bool IsPromise { get; }
    -
    Parameters
    +
    Property Value
    - - - - - - - - - - - - - - - - - - +
    TypeName Description
    ProxyServerserver
    ProxyEndPointendPoint
    Requestrequest
    CancellationTokenSourcecancellationTokenSourceBoolean
    -

    Properties -

    | - Improve this Doc + Improve this Doc - View Source + View Source - -

    IsPromise

    -

    Is this session a HTTP/2 promise?

    + +

    ReRequest

    +

    Should we send the request again ?

    Declaration
    -
    public bool IsPromise { get; }
    +
    public bool ReRequest { get; set; }
    Property Value
    @@ -262,19 +240,18 @@
    Property Value
    | - Improve this Doc + Improve this Doc - View Source + View Source - -

    ReRequest

    -

    Should we send the request again ?

    -
    + +

    WebSocketDecoder

    +
    Declaration
    -
    public bool ReRequest { get; set; }
    +
    public WebSocketDecoder WebSocketDecoder { get; }
    Property Value
    @@ -286,7 +263,7 @@
    Property Value
    - + @@ -298,7 +275,7 @@

    Methods Improve this Doc - View Source + View Source

    Dispose()

    @@ -316,7 +293,7 @@
    Overrides
    Improve this Doc - View Source + View Source

    GenericResponse(Byte[], HttpStatusCode, Dictionary<String, HttpHeader>, Boolean)

    @@ -369,7 +346,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    GenericResponse(String, HttpStatusCode, Dictionary<String, HttpHeader>, Boolean)

    @@ -423,7 +400,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    GetRequestBody(CancellationToken)

    @@ -473,7 +450,7 @@
    Returns
    Improve this Doc - View Source + View Source

    GetRequestBodyAsString(CancellationToken)

    @@ -523,7 +500,7 @@
    Returns
    Improve this Doc - View Source + View Source

    GetResponseBody(CancellationToken)

    @@ -573,7 +550,7 @@
    Returns
    Improve this Doc - View Source + View Source

    GetResponseBodyAsString(CancellationToken)

    @@ -623,7 +600,7 @@
    Returns
    Improve this Doc - View Source + View Source

    Ok(Byte[], Dictionary<String, HttpHeader>, Boolean)

    @@ -670,7 +647,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    Ok(String, Dictionary<String, HttpHeader>, Boolean)

    @@ -717,7 +694,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    Redirect(String, Boolean)

    @@ -757,7 +734,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    Respond(Response, Boolean)

    @@ -797,7 +774,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    SetRequestBody(Byte[])

    @@ -831,7 +808,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    SetRequestBodyString(String)

    @@ -865,7 +842,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    SetResponseBody(Byte[])

    @@ -899,7 +876,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    SetResponseBodyString(String)

    @@ -933,7 +910,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    TerminateServerConnection()

    @@ -951,7 +928,7 @@

    Events Improve this Doc - View Source + View Source

    MultipartRequestPartSent

    Occurs when multipart request part sent.

    @@ -991,7 +968,7 @@

    Implements

    Improve this Doc
  • - View Source + View Source
  • diff --git a/docs/api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html b/docs/api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html index 15f9157a2..d93b876ef 100644 --- a/docs/api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html +++ b/docs/api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html @@ -10,7 +10,7 @@ - + @@ -92,114 +92,129 @@

    Inheritance
    Object
    -
    EventArgs
    -
    SessionEventArgsBase
    -
    SessionEventArgs
    -
    TunnelConnectSessionEventArgs
    +
    SessionEventArgsBase
    +
    SessionEventArgs
    +
    TunnelConnectSessionEventArgs
    Implements
    IDisposable
    -
    -
    Inherited Members
    -
    - EventArgs.Empty -
    -
    - Object.Equals(Object) -
    -
    - Object.Equals(Object, Object) -
    -
    - Object.GetHashCode() -
    -
    - Object.GetType() -
    -
    - Object.MemberwiseClone() -
    -
    - Object.ReferenceEquals(Object, Object) -
    -
    - Object.ToString() -
    -
    Namespace: Titanium.Web.Proxy.EventArguments
    Assembly: Titanium.Web.Proxy.dll
    Syntax
    -
    public abstract class SessionEventArgsBase : EventArgs, IDisposable
    +
    public abstract class SessionEventArgsBase : ProxyEventArgsBase, IDisposable
    -

    Constructors +

    Fields

    | - Improve this Doc + Improve this Doc - View Source + View Source - -

    SessionEventArgsBase(ProxyServer, ProxyEndPoint, CancellationTokenSource, Request)

    +

    BufferPool

    Declaration
    -
    protected SessionEventArgsBase(ProxyServer server, ProxyEndPoint endPoint, CancellationTokenSource cancellationTokenSource, Request request)
    +
    protected readonly IBufferPool BufferPool
    -
    Parameters
    +
    Field Value
    BooleanWebSocketDecoder
    - - - + + +
    TypeName Description
    ProxyServerserverIBufferPool
    + + | + Improve this Doc + + + View Source + +

    ExceptionFunc

    +
    +
    +
    Declaration
    +
    +
    protected readonly ExceptionHandler ExceptionFunc
    +
    +
    Field Value
    + + - - - + + + + - - + + +
    ProxyEndPointendPointTypeDescription
    CancellationTokenSourcecancellationTokenSourceExceptionHandler
    +

    Properties +

    + + | + Improve this Doc + + + View Source + + +

    ClientConnectionId

    +
    +
    +
    Declaration
    +
    +
    public Guid ClientConnectionId { get; }
    +
    +
    Property Value
    + + + + + + + + - - +
    TypeDescription
    RequestrequestGuid
    -

    Fields -

    | - Improve this Doc + Improve this Doc - View Source + View Source -

    BufferPool

    + +

    ClientEndPoint

    Declaration
    -
    protected readonly IBufferPool BufferPool
    +
    [Obsolete("Use ClientRemoteEndPoint instead.")]
    +public IPEndPoint ClientEndPoint { get; }
    -
    Field Value
    +
    Property Value
    @@ -209,26 +224,28 @@
    Field Value
    - +
    IBufferPoolIPEndPoint
    | - Improve this Doc + Improve this Doc - View Source + View Source -

    ExceptionFunc

    -
    + +

    ClientLocalEndPoint

    +

    Client Local End Point.

    +
    Declaration
    -
    protected readonly ExceptionHandler ExceptionFunc
    +
    public IPEndPoint ClientLocalEndPoint { get; }
    -
    Field Value
    +
    Property Value
    @@ -238,28 +255,26 @@
    Field Value
    - +
    ExceptionHandlerIPEndPoint
    -

    Properties -

    | - Improve this Doc + Improve this Doc - View Source + View Source - -

    ClientEndPoint

    -

    Client End Point.

    + +

    ClientRemoteEndPoint

    +

    Client Remote End Point.

    Declaration
    -
    public IPEndPoint ClientEndPoint { get; }
    +
    public IPEndPoint ClientRemoteEndPoint { get; }
    Property Value
    @@ -276,12 +291,44 @@
    Property Value
    + + | + Improve this Doc + + + View Source + + +

    CustomUpStreamProxy

    +

    Gets or sets the custom up stream proxy.

    +
    +
    +
    Declaration
    +
    +
    public IExternalProxy? CustomUpStreamProxy { get; set; }
    +
    +
    Property Value
    + + + + + + + + + + + + + +
    TypeDescription
    Nullable<IExternalProxy>

    The custom up stream proxy.

    +
    | Improve this Doc - View Source + View Source

    CustomUpStreamProxyUsed

    @@ -290,7 +337,38 @@

    Declaration
    -
    public ExternalProxy CustomUpStreamProxyUsed { get; }
    +
    public IExternalProxy? CustomUpStreamProxyUsed { get; }
    +
    +
    Property Value
    + + + + + + + + + + + + + +
    TypeDescription
    Nullable<IExternalProxy>
    + + | + Improve this Doc + + + View Source + + +

    EnableWinAuth

    +

    Enable/disable Windows Authentication (NTLM/Kerberos) for the current session.

    +
    +
    +
    Declaration
    +
    +
    public bool EnableWinAuth { get; set; }
    Property Value
    @@ -302,7 +380,7 @@
    Property Value
    - + @@ -312,7 +390,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    Exception

    @@ -343,7 +421,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    HttpClient

    @@ -374,7 +452,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    IsHttps

    @@ -405,7 +483,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    IsTransparent

    @@ -436,16 +514,47 @@
    Property Value
    Improve this Doc - View Source + View Source

    LocalEndPoint

    +
    +
    +
    Declaration
    +
    +
    [Obsolete("Use ProxyEndPoint instead.")]
    +public ProxyEndPoint LocalEndPoint { get; }
    +
    +
    Property Value
    +
    ExternalProxyBoolean
    + + + + + + + + + + + + +
    TypeDescription
    ProxyEndPoint
    + + | + Improve this Doc + + + View Source + + +

    ProxyEndPoint

    Local endpoint via which we make the request.

    Declaration
    -
    public ProxyEndPoint LocalEndPoint { get; }
    +
    public ProxyEndPoint ProxyEndPoint { get; }
    Property Value
    @@ -462,12 +571,42 @@
    Property Value
    + + | + Improve this Doc + + + View Source + + +

    ServerConnectionId

    +
    +
    +
    Declaration
    +
    +
    public Guid ServerConnectionId { get; }
    +
    +
    Property Value
    + + + + + + + + + + + + + +
    TypeDescription
    Guid
    | Improve this Doc - View Source + View Source

    TimeLine

    @@ -498,7 +637,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    UserData

    @@ -530,7 +669,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    WebSession

    @@ -563,7 +702,7 @@

    Methods Improve this Doc - View Source + View Source

    Dispose()

    @@ -579,7 +718,7 @@
    Declaration
    Improve this Doc - View Source + View Source

    TerminateSession()

    @@ -597,7 +736,7 @@

    Events Improve this Doc - View Source + View Source

    DataReceived

    Fired when data is received within this session from client/server.

    @@ -627,7 +766,7 @@
    Event Type
    Improve this Doc - View Source + View Source

    DataSent

    Fired when data is sent within this session to server/client.

    @@ -667,7 +806,7 @@

    Implements

    Improve this Doc
  • - View Source + View Source
  • diff --git a/docs/api/Titanium.Web.Proxy.EventArguments.TunnelConnectSessionEventArgs.html b/docs/api/Titanium.Web.Proxy.EventArguments.TunnelConnectSessionEventArgs.html index c91195e7c..9d1257b4a 100644 --- a/docs/api/Titanium.Web.Proxy.EventArguments.TunnelConnectSessionEventArgs.html +++ b/docs/api/Titanium.Web.Proxy.EventArguments.TunnelConnectSessionEventArgs.html @@ -10,7 +10,7 @@ - + @@ -89,9 +89,8 @@

    Inheritance
    Object
    -
    EventArgs
    -
    SessionEventArgsBase
    -
    TunnelConnectSessionEventArgs
    +
    SessionEventArgsBase
    +
    TunnelConnectSessionEventArgs
    Implements
    @@ -99,6 +98,12 @@
    Implements
    Inherited Members
    +
    + SessionEventArgsBase.ClientConnectionId +
    +
    + SessionEventArgsBase.ServerConnectionId +
    SessionEventArgsBase.BufferPool
    @@ -111,9 +116,18 @@
    Inherited Members
    SessionEventArgsBase.UserData
    +
    + SessionEventArgsBase.EnableWinAuth +
    SessionEventArgsBase.IsHttps
    +
    + SessionEventArgsBase.ClientLocalEndPoint +
    +
    + SessionEventArgsBase.ClientRemoteEndPoint +
    SessionEventArgsBase.ClientEndPoint
    @@ -123,9 +137,15 @@
    Inherited Members
    SessionEventArgsBase.WebSession
    +
    + SessionEventArgsBase.CustomUpStreamProxy +
    SessionEventArgsBase.CustomUpStreamProxyUsed
    +
    + SessionEventArgsBase.ProxyEndPoint +
    SessionEventArgsBase.LocalEndPoint
    @@ -147,30 +167,6 @@
    Inherited Members
    SessionEventArgsBase.TerminateSession()
    -
    - EventArgs.Empty -
    -
    - Object.Equals(Object) -
    -
    - Object.Equals(Object, Object) -
    -
    - Object.GetHashCode() -
    -
    - Object.GetType() -
    -
    - Object.MemberwiseClone() -
    -
    - Object.ReferenceEquals(Object, Object) -
    -
    - Object.ToString() -
    Namespace: Titanium.Web.Proxy.EventArguments
    Assembly: Titanium.Web.Proxy.dll
    @@ -351,7 +347,7 @@

    Implements

    Improve this Doc
  • - View Source + View Source
  • diff --git a/docs/api/Titanium.Web.Proxy.EventArguments.html b/docs/api/Titanium.Web.Proxy.EventArguments.html index eeec5ed88..d98e5412c 100644 --- a/docs/api/Titanium.Web.Proxy.EventArguments.html +++ b/docs/api/Titanium.Web.Proxy.EventArguments.html @@ -10,7 +10,7 @@ - + diff --git a/docs/api/Titanium.Web.Proxy.ExceptionHandler.html b/docs/api/Titanium.Web.Proxy.ExceptionHandler.html index 92c526488..641aa9e61 100644 --- a/docs/api/Titanium.Web.Proxy.ExceptionHandler.html +++ b/docs/api/Titanium.Web.Proxy.ExceptionHandler.html @@ -10,7 +10,7 @@ - + diff --git a/docs/api/Titanium.Web.Proxy.Exceptions.BodyNotFoundException.html b/docs/api/Titanium.Web.Proxy.Exceptions.BodyNotFoundException.html index fc41cd021..7b705de40 100644 --- a/docs/api/Titanium.Web.Proxy.Exceptions.BodyNotFoundException.html +++ b/docs/api/Titanium.Web.Proxy.Exceptions.BodyNotFoundException.html @@ -10,7 +10,7 @@ - + @@ -96,12 +96,16 @@
    Inheritance
    Implements
    ISerializable
    +
    _Exception
    Inherited Members
    Exception.GetBaseException()
    +
    + Exception.ToString() +
    Exception.GetObjectData(SerializationInfo, StreamingContext)
    @@ -109,31 +113,28 @@
    Inherited Members
    Exception.GetType()
    - Exception.ToString() + Exception.Message
    Exception.Data
    - Exception.HelpLink + Exception.InnerException
    - Exception.HResult + Exception.TargetSite
    - Exception.InnerException + Exception.StackTrace
    - Exception.Message + Exception.HelpLink
    Exception.Source
    - Exception.StackTrace -
    -
    - Exception.TargetSite + Exception.HResult
    Exception.SerializeObjectState @@ -145,25 +146,28 @@
    Inherited Members
    Object.Equals(Object, Object)
    - Object.GetHashCode() + Object.ReferenceEquals(Object, Object)
    - Object.MemberwiseClone() + Object.GetHashCode()
    - Object.ReferenceEquals(Object, Object) + Object.MemberwiseClone()
    Namespace: Titanium.Web.Proxy.Exceptions
    Assembly: Titanium.Web.Proxy.dll
    Syntax
    -
    public class BodyNotFoundException : ProxyException, ISerializable
    +
    public class BodyNotFoundException : ProxyException, ISerializable, _Exception

    Implements

    System.Runtime.Serialization.ISerializable
    +
    + System.Runtime.InteropServices._Exception +
    diff --git a/docs/api/Titanium.Web.Proxy.Exceptions.ProxyAuthorizationException.html b/docs/api/Titanium.Web.Proxy.Exceptions.ProxyAuthorizationException.html index d53f9d17d..8a63bd68a 100644 --- a/docs/api/Titanium.Web.Proxy.Exceptions.ProxyAuthorizationException.html +++ b/docs/api/Titanium.Web.Proxy.Exceptions.ProxyAuthorizationException.html @@ -10,7 +10,7 @@ - + @@ -96,12 +96,16 @@
    Inheritance
    Implements
    ISerializable
    +
    _Exception
    Inherited Members
    Exception.GetBaseException()
    +
    + Exception.ToString() +
    Exception.GetObjectData(SerializationInfo, StreamingContext)
    @@ -109,31 +113,28 @@
    Inherited Members
    Exception.GetType()
    - Exception.ToString() + Exception.Message
    Exception.Data
    - Exception.HelpLink + Exception.InnerException
    - Exception.HResult + Exception.TargetSite
    - Exception.InnerException + Exception.StackTrace
    - Exception.Message + Exception.HelpLink
    Exception.Source
    - Exception.StackTrace -
    -
    - Exception.TargetSite + Exception.HResult
    Exception.SerializeObjectState @@ -145,20 +146,20 @@
    Inherited Members
    Object.Equals(Object, Object)
    - Object.GetHashCode() + Object.ReferenceEquals(Object, Object)
    - Object.MemberwiseClone() + Object.GetHashCode()
    - Object.ReferenceEquals(Object, Object) + Object.MemberwiseClone()
    Namespace: Titanium.Web.Proxy.Exceptions
    Assembly: Titanium.Web.Proxy.dll
    Syntax
    -
    public class ProxyAuthorizationException : ProxyException, ISerializable
    +
    public class ProxyAuthorizationException : ProxyException, ISerializable, _Exception

    Properties

    @@ -228,6 +229,9 @@

    Implements

    System.Runtime.Serialization.ISerializable
    +
    + System.Runtime.InteropServices._Exception +
    diff --git a/docs/api/Titanium.Web.Proxy.Exceptions.ProxyConnectException.html b/docs/api/Titanium.Web.Proxy.Exceptions.ProxyConnectException.html index 6419c0d24..ced38456e 100644 --- a/docs/api/Titanium.Web.Proxy.Exceptions.ProxyConnectException.html +++ b/docs/api/Titanium.Web.Proxy.Exceptions.ProxyConnectException.html @@ -10,7 +10,7 @@ - + @@ -96,12 +96,16 @@
    Inheritance
    Implements
    ISerializable
    +
    _Exception
    Inherited Members
    Exception.GetBaseException()
    +
    + Exception.ToString() +
    Exception.GetObjectData(SerializationInfo, StreamingContext)
    @@ -109,31 +113,28 @@
    Inherited Members
    Exception.GetType()
    - Exception.ToString() + Exception.Message
    Exception.Data
    - Exception.HelpLink + Exception.InnerException
    - Exception.HResult + Exception.TargetSite
    - Exception.InnerException + Exception.StackTrace
    - Exception.Message + Exception.HelpLink
    Exception.Source
    - Exception.StackTrace -
    -
    - Exception.TargetSite + Exception.HResult
    Exception.SerializeObjectState @@ -145,20 +146,20 @@
    Inherited Members
    Object.Equals(Object, Object)
    - Object.GetHashCode() + Object.ReferenceEquals(Object, Object)
    - Object.MemberwiseClone() + Object.GetHashCode()
    - Object.ReferenceEquals(Object, Object) + Object.MemberwiseClone()
    Namespace: Titanium.Web.Proxy.Exceptions
    Assembly: Titanium.Web.Proxy.dll
    Syntax
    -
    public class ProxyConnectException : ProxyException, ISerializable
    +
    public class ProxyConnectException : ProxyException, ISerializable, _Exception

    Properties

    @@ -200,6 +201,9 @@

    Implements

    System.Runtime.Serialization.ISerializable
    +
    + System.Runtime.InteropServices._Exception +
    diff --git a/docs/api/Titanium.Web.Proxy.Exceptions.ProxyException.html b/docs/api/Titanium.Web.Proxy.Exceptions.ProxyException.html index 7c5a55c60..46e6afd62 100644 --- a/docs/api/Titanium.Web.Proxy.Exceptions.ProxyException.html +++ b/docs/api/Titanium.Web.Proxy.Exceptions.ProxyException.html @@ -10,7 +10,7 @@ - + @@ -100,12 +100,16 @@
    Inheritance
    Implements
    ISerializable
    +
    _Exception
    Inherited Members
    Exception.GetBaseException()
    +
    + Exception.ToString() +
    Exception.GetObjectData(SerializationInfo, StreamingContext)
    @@ -113,31 +117,28 @@
    Inherited Members
    Exception.GetType()
    - Exception.ToString() + Exception.Message
    Exception.Data
    - Exception.HelpLink + Exception.InnerException
    - Exception.HResult + Exception.TargetSite
    - Exception.InnerException + Exception.StackTrace
    - Exception.Message + Exception.HelpLink
    Exception.Source
    - Exception.StackTrace -
    -
    - Exception.TargetSite + Exception.HResult
    Exception.SerializeObjectState @@ -149,20 +150,20 @@
    Inherited Members
    Object.Equals(Object, Object)
    - Object.GetHashCode() + Object.ReferenceEquals(Object, Object)
    - Object.MemberwiseClone() + Object.GetHashCode()
    - Object.ReferenceEquals(Object, Object) + Object.MemberwiseClone()
    Namespace: Titanium.Web.Proxy.Exceptions
    Assembly: Titanium.Web.Proxy.dll
    Syntax
    -
    public abstract class ProxyException : Exception, ISerializable
    +
    public abstract class ProxyException : Exception, ISerializable, _Exception

    Constructors

    @@ -250,6 +251,9 @@

    Implements

    System.Runtime.Serialization.ISerializable
    +
    + System.Runtime.InteropServices._Exception +
    diff --git a/docs/api/Titanium.Web.Proxy.Exceptions.ProxyHttpException.html b/docs/api/Titanium.Web.Proxy.Exceptions.ProxyHttpException.html index 53529dc87..6ab87056f 100644 --- a/docs/api/Titanium.Web.Proxy.Exceptions.ProxyHttpException.html +++ b/docs/api/Titanium.Web.Proxy.Exceptions.ProxyHttpException.html @@ -10,7 +10,7 @@ - + @@ -96,12 +96,16 @@
    Inheritance
    Implements
    ISerializable
    +
    _Exception
    Inherited Members
    Exception.GetBaseException()
    +
    + Exception.ToString() +
    Exception.GetObjectData(SerializationInfo, StreamingContext)
    @@ -109,31 +113,28 @@
    Inherited Members
    Exception.GetType()
    - Exception.ToString() + Exception.Message
    Exception.Data
    - Exception.HelpLink + Exception.InnerException
    - Exception.HResult + Exception.TargetSite
    - Exception.InnerException + Exception.StackTrace
    - Exception.Message + Exception.HelpLink
    Exception.Source
    - Exception.StackTrace -
    -
    - Exception.TargetSite + Exception.HResult
    Exception.SerializeObjectState @@ -145,20 +146,20 @@
    Inherited Members
    Object.Equals(Object, Object)
    - Object.GetHashCode() + Object.ReferenceEquals(Object, Object)
    - Object.MemberwiseClone() + Object.GetHashCode()
    - Object.ReferenceEquals(Object, Object) + Object.MemberwiseClone()
    Namespace: Titanium.Web.Proxy.Exceptions
    Assembly: Titanium.Web.Proxy.dll
    Syntax
    -
    public class ProxyHttpException : ProxyException, ISerializable
    +
    public class ProxyHttpException : ProxyException, ISerializable, _Exception

    Properties

    @@ -200,6 +201,9 @@

    Implements

    System.Runtime.Serialization.ISerializable
    +
    + System.Runtime.InteropServices._Exception +
    diff --git a/docs/api/Titanium.Web.Proxy.Exceptions.ServerConnectionException.html b/docs/api/Titanium.Web.Proxy.Exceptions.ServerConnectionException.html index f255e0202..d34352c70 100644 --- a/docs/api/Titanium.Web.Proxy.Exceptions.ServerConnectionException.html +++ b/docs/api/Titanium.Web.Proxy.Exceptions.ServerConnectionException.html @@ -10,7 +10,7 @@ - + @@ -97,12 +97,16 @@
    Inheritance
    Implements
    ISerializable
    +
    _Exception
    Inherited Members
    Exception.GetBaseException()
    +
    + Exception.ToString() +
    Exception.GetObjectData(SerializationInfo, StreamingContext)
    @@ -110,31 +114,28 @@
    Inherited Members
    Exception.GetType()
    - Exception.ToString() + Exception.Message
    Exception.Data
    - Exception.HelpLink + Exception.InnerException
    - Exception.HResult + Exception.TargetSite
    - Exception.InnerException + Exception.StackTrace
    - Exception.Message + Exception.HelpLink
    Exception.Source
    - Exception.StackTrace -
    -
    - Exception.TargetSite + Exception.HResult
    Exception.SerializeObjectState @@ -146,25 +147,28 @@
    Inherited Members
    Object.Equals(Object, Object)
    - Object.GetHashCode() + Object.ReferenceEquals(Object, Object)
    - Object.MemberwiseClone() + Object.GetHashCode()
    - Object.ReferenceEquals(Object, Object) + Object.MemberwiseClone()
    Namespace: Titanium.Web.Proxy.Exceptions
    Assembly: Titanium.Web.Proxy.dll
    Syntax
    -
    public class ServerConnectionException : ProxyException, ISerializable
    +
    public class ServerConnectionException : ProxyException, ISerializable, _Exception

    Implements

    System.Runtime.Serialization.ISerializable
    +
    + System.Runtime.InteropServices._Exception +
    diff --git a/docs/api/Titanium.Web.Proxy.Exceptions.html b/docs/api/Titanium.Web.Proxy.Exceptions.html index 5bf0611b3..d393a903d 100644 --- a/docs/api/Titanium.Web.Proxy.Exceptions.html +++ b/docs/api/Titanium.Web.Proxy.Exceptions.html @@ -10,7 +10,7 @@ - + diff --git a/docs/api/Titanium.Web.Proxy.Helpers.RunTime.html b/docs/api/Titanium.Web.Proxy.Helpers.RunTime.html index 6137f8083..454bf5337 100644 --- a/docs/api/Titanium.Web.Proxy.Helpers.RunTime.html +++ b/docs/api/Titanium.Web.Proxy.Helpers.RunTime.html @@ -10,7 +10,7 @@ - + @@ -93,12 +93,18 @@
    Inheritance
    Inherited Members
    +
    + Object.ToString() +
    Object.Equals(Object)
    Object.Equals(Object, Object)
    +
    + Object.ReferenceEquals(Object, Object) +
    Object.GetHashCode()
    @@ -108,12 +114,6 @@
    Inherited Members
    Object.MemberwiseClone()
    -
    - Object.ReferenceEquals(Object, Object) -
    -
    - Object.ToString() -
    Namespace: Titanium.Web.Proxy.Helpers
    Assembly: Titanium.Web.Proxy.dll
    @@ -128,7 +128,7 @@

    Properties Improve this Doc - View Source + View Source

    IsLinux

    @@ -158,7 +158,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    IsMac

    @@ -183,12 +183,43 @@
    Property Value
    + + | + Improve this Doc + + + View Source + + +

    IsSocketReuseAvailable

    +

    Is socket reuse available to use?

    +
    +
    +
    Declaration
    +
    +
    public static bool IsSocketReuseAvailable { get; }
    +
    +
    Property Value
    + + + + + + + + + + + + + +
    TypeDescription
    Boolean
    | Improve this Doc - View Source + View Source

    IsUwpOnWindows

    @@ -218,7 +249,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    IsWindows

    @@ -254,7 +285,7 @@
    Property Value
    Improve this Doc
  • - View Source + View Source
  • diff --git a/docs/api/Titanium.Web.Proxy.Helpers.html b/docs/api/Titanium.Web.Proxy.Helpers.html index db3f6f65d..28fc00268 100644 --- a/docs/api/Titanium.Web.Proxy.Helpers.html +++ b/docs/api/Titanium.Web.Proxy.Helpers.html @@ -10,7 +10,7 @@ - + diff --git a/docs/api/Titanium.Web.Proxy.Http.ConnectRequest.html b/docs/api/Titanium.Web.Proxy.Http.ConnectRequest.html index a13ca1f90..e3c7a2e0e 100644 --- a/docs/api/Titanium.Web.Proxy.Http.ConnectRequest.html +++ b/docs/api/Titanium.Web.Proxy.Http.ConnectRequest.html @@ -10,7 +10,7 @@ - + @@ -99,13 +99,13 @@
    Inherited Members
    Request.Method
    - Request.RequestUri + Request.IsHttps
    - Request.IsHttps + Request.RequestUri
    - Request.OriginalUrl + Request.Url
    Request.RequestUriString @@ -122,9 +122,6 @@
    Inherited Members
    Request.IsMultipartFormData
    -
    - Request.Url -
    Request.UpgradeToWebSocket
    @@ -182,6 +179,9 @@
    Inherited Members
    Object.Equals(Object, Object)
    +
    + Object.ReferenceEquals(Object, Object) +
    Object.GetHashCode()
    @@ -191,9 +191,6 @@
    Inherited Members
    Object.MemberwiseClone()
    -
    - Object.ReferenceEquals(Object, Object) -
    Namespace: Titanium.Web.Proxy.Http
    Assembly: Titanium.Web.Proxy.dll
    @@ -201,23 +198,6 @@
    Syntax
    public class ConnectRequest : Request
    -

    Constructors -

    - - | - Improve this Doc - - - View Source - - -

    ConnectRequest()

    -
    -
    -
    Declaration
    -
    -
    public ConnectRequest()
    -

    Properties

    @@ -225,7 +205,7 @@

    Properties Improve this Doc - View Source + View Source

    ClientHelloInfo

    @@ -233,7 +213,7 @@

    Declaration
    -
    public ClientHelloInfo ClientHelloInfo { get; set; }
    +
    public ClientHelloInfo? ClientHelloInfo { get; set; }
    Property Value
    @@ -245,7 +225,7 @@
    Property Value
    - + @@ -255,7 +235,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    TunnelType

    @@ -291,7 +271,7 @@
    Property Value
    Improve this Doc
  • - View Source + View Source
  • diff --git a/docs/api/Titanium.Web.Proxy.Http.ConnectResponse.html b/docs/api/Titanium.Web.Proxy.Http.ConnectResponse.html index 0c6e122d1..c4b97328b 100644 --- a/docs/api/Titanium.Web.Proxy.Http.ConnectResponse.html +++ b/docs/api/Titanium.Web.Proxy.Http.ConnectResponse.html @@ -10,7 +10,7 @@ - + @@ -155,6 +155,9 @@
    Inherited Members
    Object.Equals(Object, Object)
    +
    + Object.ReferenceEquals(Object, Object) +
    Object.GetHashCode()
    @@ -164,9 +167,6 @@
    Inherited Members
    Object.MemberwiseClone()
    -
    - Object.ReferenceEquals(Object, Object) -
    Namespace: Titanium.Web.Proxy.Http
    Assembly: Titanium.Web.Proxy.dll
    @@ -189,7 +189,7 @@

    Declaration
    -
    public ServerHelloInfo ServerHelloInfo { get; set; }
    +
    public ServerHelloInfo? ServerHelloInfo { get; set; }
    Property Value
    ClientHelloInfoNullable<ClientHelloInfo>
    @@ -201,7 +201,7 @@
    Property Value
    - + diff --git a/docs/api/Titanium.Web.Proxy.Http.HeaderCollection.html b/docs/api/Titanium.Web.Proxy.Http.HeaderCollection.html index 76fed6297..def6dfea6 100644 --- a/docs/api/Titanium.Web.Proxy.Http.HeaderCollection.html +++ b/docs/api/Titanium.Web.Proxy.Http.HeaderCollection.html @@ -10,7 +10,7 @@ - + @@ -98,12 +98,18 @@
    Implements
    Inherited Members
    +
    + Object.ToString() +
    Object.Equals(Object)
    Object.Equals(Object, Object)
    +
    + Object.ReferenceEquals(Object, Object) +
    Object.GetHashCode()
    @@ -113,12 +119,6 @@
    Inherited Members
    Object.MemberwiseClone()
    -
    - Object.ReferenceEquals(Object, Object) -
    -
    - Object.ToString() -
    Namespace: Titanium.Web.Proxy.Http
    Assembly: Titanium.Web.Proxy.dll
    @@ -216,7 +216,7 @@

    Methods Improve this Doc - View Source + View Source

    AddHeader(String, String)

    @@ -254,7 +254,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    AddHeader(HttpHeader)

    @@ -287,7 +287,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    AddHeaders(IEnumerable<KeyValuePair<String, String>>)

    @@ -320,7 +320,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    AddHeaders(IEnumerable<KeyValuePair<String, HttpHeader>>)

    @@ -353,7 +353,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    AddHeaders(IEnumerable<HttpHeader>)

    @@ -386,7 +386,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    Clear()

    @@ -402,7 +402,7 @@
    Declaration
    Improve this Doc - View Source + View Source

    GetAllHeaders()

    @@ -604,12 +604,62 @@
    Returns
    ServerHelloInfoNullable<ServerHelloInfo>
    + + | + Improve this Doc + + + View Source + + +

    RemoveHeader(KnownHeader)

    +

    removes all headers with given name

    +
    +
    +
    Declaration
    +
    +
    public bool RemoveHeader(KnownHeader headerName)
    +
    +
    Parameters
    + + + + + + + + + + + + + + + +
    TypeNameDescription
    KnownHeaderheaderName
    +
    Returns
    + + + + + + + + + + + + + +
    TypeDescription
    Boolean

    True if header was removed +False if no header exists with given name

    +
    | Improve this Doc - View Source + View Source

    RemoveHeader(String)

    @@ -659,7 +709,7 @@
    Returns
    Improve this Doc
    - View Source + View Source

    RemoveHeader(HttpHeader)

    diff --git a/docs/api/Titanium.Web.Proxy.Http.HttpWebClient.html b/docs/api/Titanium.Web.Proxy.Http.HttpWebClient.html index 5269ce0be..7eda9c7c3 100644 --- a/docs/api/Titanium.Web.Proxy.Http.HttpWebClient.html +++ b/docs/api/Titanium.Web.Proxy.Http.HttpWebClient.html @@ -10,7 +10,7 @@ - + @@ -93,12 +93,18 @@
    Inheritance
    Inherited Members
    +
    + Object.ToString() +
    Object.Equals(Object)
    Object.Equals(Object, Object)
    +
    + Object.ReferenceEquals(Object, Object) +
    Object.GetHashCode()
    @@ -108,12 +114,6 @@
    Inherited Members
    Object.MemberwiseClone()
    -
    - Object.ReferenceEquals(Object, Object) -
    -
    - Object.ToString() -
    Namespace: Titanium.Web.Proxy.Http
    Assembly: Titanium.Web.Proxy.dll
    @@ -128,7 +128,7 @@

    Properties Improve this Doc - View Source + View Source

    ConnectRequest

    @@ -159,7 +159,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    IsHttps

    @@ -190,7 +190,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    ProcessId

    @@ -222,7 +222,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    Request

    @@ -253,7 +253,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    Response

    @@ -284,7 +284,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    UpStreamEndPoint

    @@ -315,7 +315,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    UserData

    @@ -352,7 +352,7 @@
    Property Value
    Improve this Doc
  • - View Source + View Source
  • diff --git a/docs/api/Titanium.Web.Proxy.Http.KnownHeaders.html b/docs/api/Titanium.Web.Proxy.Http.KnownHeaders.html index 4c67c7a67..94b912e0b 100644 --- a/docs/api/Titanium.Web.Proxy.Http.KnownHeaders.html +++ b/docs/api/Titanium.Web.Proxy.Http.KnownHeaders.html @@ -10,7 +10,7 @@ - + @@ -93,12 +93,18 @@
    Inheritance
    Inherited Members
    +
    + Object.ToString() +
    Object.Equals(Object)
    Object.Equals(Object, Object)
    +
    + Object.ReferenceEquals(Object, Object) +
    Object.GetHashCode()
    @@ -108,12 +114,6 @@
    Inherited Members
    Object.MemberwiseClone()
    -
    - Object.ReferenceEquals(Object, Object) -
    -
    - Object.ToString() -
    Namespace: Titanium.Web.Proxy.Http
    Assembly: Titanium.Web.Proxy.dll
    @@ -135,7 +135,7 @@

    Declaration
    -
    public const string AcceptEncoding = "Accept-Encoding"
    +
    public static KnownHeader AcceptEncoding
    Field Value
    @@ -147,7 +147,7 @@
    Field Value
    - + @@ -164,7 +164,7 @@

    Declaration
    -
    public const string Authorization = "Authorization"
    +
    public static KnownHeader Authorization
    Field Value
    StringKnownHeader
    @@ -176,7 +176,7 @@
    Field Value
    - + @@ -193,7 +193,7 @@

    Declaration
    -
    public const string Connection = "Connection"
    +
    public static KnownHeader Connection
    Field Value
    StringKnownHeader
    @@ -205,7 +205,7 @@
    Field Value
    - + @@ -222,7 +222,7 @@

    Declaration
    -
    public const string ConnectionClose = "close"
    +
    public static KnownHeader ConnectionClose
    Field Value
    StringKnownHeader
    @@ -234,7 +234,7 @@
    Field Value
    - + @@ -251,7 +251,7 @@

    Declaration
    -
    public const string ConnectionKeepAlive = "keep-alive"
    +
    public static KnownHeader ConnectionKeepAlive
    Field Value
    StringKnownHeader
    @@ -263,7 +263,7 @@
    Field Value
    - + @@ -280,7 +280,7 @@

    Declaration
    -
    public const string ContentEncoding = "Content-Encoding"
    +
    public static KnownHeader ContentEncoding
    Field Value
    StringKnownHeader
    @@ -292,7 +292,7 @@
    Field Value
    - + @@ -309,7 +309,7 @@

    Declaration
    -
    public const string ContentEncodingBrotli = "br"
    +
    public static KnownHeader ContentEncodingBrotli
    Field Value
    StringKnownHeader
    @@ -321,7 +321,7 @@
    Field Value
    - + @@ -338,7 +338,7 @@

    Declaration
    -
    public const string ContentEncodingDeflate = "deflate"
    +
    public static KnownHeader ContentEncodingDeflate
    Field Value
    StringKnownHeader
    @@ -350,7 +350,7 @@
    Field Value
    - + @@ -367,7 +367,7 @@

    Declaration
    -
    public const string ContentEncodingGzip = "gzip"
    +
    public static KnownHeader ContentEncodingGzip
    Field Value
    StringKnownHeader
    @@ -379,7 +379,7 @@
    Field Value
    - + @@ -396,7 +396,7 @@

    Declaration
    -
    public const string ContentLength = "Content-Length"
    +
    public static KnownHeader ContentLength
    Field Value
    StringKnownHeader
    @@ -408,7 +408,7 @@
    Field Value
    - + @@ -425,7 +425,7 @@

    Declaration
    -
    public const string ContentType = "Content-Type"
    +
    public static KnownHeader ContentType
    Field Value
    StringKnownHeader
    @@ -437,7 +437,7 @@
    Field Value
    - + @@ -454,7 +454,7 @@

    Declaration
    -
    public const string ContentTypeBoundary = "boundary"
    +
    public static KnownHeader ContentTypeBoundary
    Field Value
    StringKnownHeader
    @@ -466,7 +466,7 @@
    Field Value
    - + @@ -483,7 +483,7 @@

    Declaration
    -
    public const string ContentTypeCharset = "charset"
    +
    public static KnownHeader ContentTypeCharset
    Field Value
    StringKnownHeader
    @@ -495,7 +495,7 @@
    Field Value
    - + @@ -512,7 +512,7 @@

    Declaration
    -
    public const string Expect = "Expect"
    +
    public static KnownHeader Expect
    Field Value
    StringKnownHeader
    @@ -524,7 +524,7 @@
    Field Value
    - + @@ -541,7 +541,7 @@

    Declaration
    -
    public const string Expect100Continue = "100-continue"
    +
    public static KnownHeader Expect100Continue
    Field Value
    StringKnownHeader
    @@ -553,7 +553,7 @@
    Field Value
    - + @@ -570,7 +570,7 @@

    Declaration
    -
    public const string Host = "Host"
    +
    public static KnownHeader Host
    Field Value
    StringKnownHeader
    @@ -582,7 +582,7 @@
    Field Value
    - + @@ -599,7 +599,7 @@

    Declaration
    -
    public const string Location = "Location"
    +
    public static KnownHeader Location
    Field Value
    StringKnownHeader
    @@ -611,7 +611,7 @@
    Field Value
    - + @@ -628,7 +628,7 @@

    Declaration
    -
    public const string ProxyAuthenticate = "Proxy-Authenticate"
    +
    public static KnownHeader ProxyAuthenticate
    Field Value
    StringKnownHeader
    @@ -640,7 +640,7 @@
    Field Value
    - + @@ -657,7 +657,7 @@

    Declaration
    -
    public const string ProxyAuthorization = "Proxy-Authorization"
    +
    public static KnownHeader ProxyAuthorization
    Field Value
    StringKnownHeader
    @@ -669,7 +669,7 @@
    Field Value
    - + @@ -686,7 +686,7 @@

    Declaration
    -
    public const string ProxyAuthorizationBasic = "basic"
    +
    public static KnownHeader ProxyAuthorizationBasic
    Field Value
    StringKnownHeader
    @@ -698,7 +698,7 @@
    Field Value
    - + @@ -715,7 +715,7 @@

    Declaration
    -
    public const string ProxyConnection = "Proxy-Connection"
    +
    public static KnownHeader ProxyConnection
    Field Value
    StringKnownHeader
    @@ -727,7 +727,7 @@
    Field Value
    - + @@ -744,7 +744,7 @@

    Declaration
    -
    public const string ProxyConnectionClose = "close"
    +
    public static KnownHeader ProxyConnectionClose
    Field Value
    StringKnownHeader
    @@ -756,7 +756,7 @@
    Field Value
    - + @@ -773,7 +773,7 @@

    Declaration
    -
    public const string TransferEncoding = "Transfer-Encoding"
    +
    public static KnownHeader TransferEncoding
    Field Value
    StringKnownHeader
    @@ -785,7 +785,7 @@
    Field Value
    - + @@ -802,7 +802,7 @@

    Declaration
    -
    public const string TransferEncodingChunked = "chunked"
    +
    public static KnownHeader TransferEncodingChunked
    Field Value
    StringKnownHeader
    @@ -814,7 +814,7 @@
    Field Value
    - + @@ -831,7 +831,7 @@

    Declaration
    -
    public const string Upgrade = "Upgrade"
    +
    public static KnownHeader Upgrade
    Field Value
    StringKnownHeader
    @@ -843,7 +843,7 @@
    Field Value
    - + @@ -860,7 +860,7 @@

    Declaration
    -
    public const string UpgradeWebsocket = "websocket"
    +
    public static KnownHeader UpgradeWebsocket
    Field Value
    StringKnownHeader
    @@ -872,7 +872,7 @@
    Field Value
    - + diff --git a/docs/api/Titanium.Web.Proxy.Http.Request.html b/docs/api/Titanium.Web.Proxy.Http.Request.html index 80a8f774a..395fe6164 100644 --- a/docs/api/Titanium.Web.Proxy.Http.Request.html +++ b/docs/api/Titanium.Web.Proxy.Http.Request.html @@ -10,7 +10,7 @@ - + @@ -140,6 +140,9 @@
    Inherited Members
    Object.Equals(Object, Object)
    +
    + Object.ReferenceEquals(Object, Object) +
    Object.GetHashCode()
    @@ -149,9 +152,6 @@
    Inherited Members
    Object.MemberwiseClone()
    -
    - Object.ReferenceEquals(Object, Object) -
    Namespace: Titanium.Web.Proxy.Http
    Assembly: Titanium.Web.Proxy.dll
    @@ -167,7 +167,7 @@

    Properties Improve this Doc - View Source + View Source

    ExpectationFailed

    @@ -198,7 +198,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    ExpectationSucceeded

    @@ -229,7 +229,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    ExpectContinue

    @@ -260,7 +260,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    HasBody

    @@ -293,7 +293,7 @@
    Overrides
    Improve this Doc - View Source + View Source

    HeaderText

    @@ -326,7 +326,7 @@
    Overrides
    Improve this Doc - View Source + View Source

    Host

    @@ -359,7 +359,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    IsHttps

    @@ -390,7 +390,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    IsMultipartFormData

    @@ -421,7 +421,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    Method

    @@ -447,43 +447,12 @@
    Property Value
    StringKnownHeader
    - - | - Improve this Doc - - - View Source - - -

    OriginalUrl

    -

    The original request Url.

    -
    -
    -
    Declaration
    -
    -
    public string OriginalUrl { get; }
    -
    -
    Property Value
    - - - - - - - - - - - - - -
    TypeDescription
    String
    | Improve this Doc - View Source + View Source

    RequestUri

    @@ -514,7 +483,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    RequestUriString

    @@ -545,7 +514,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    UpgradeToWebSocket

    @@ -576,16 +545,16 @@
    Property Value
    Improve this Doc - View Source + View Source

    Url

    -

    Request Url.

    +

    The request url as it is in the HTTP header

    Declaration
    -
    public string Url { get; }
    +
    public string Url { get; set; }
    Property Value
    @@ -613,7 +582,7 @@
    Property Value
    Improve this Doc
  • - View Source + View Source
  • diff --git a/docs/api/Titanium.Web.Proxy.Http.RequestResponseBase.html b/docs/api/Titanium.Web.Proxy.Http.RequestResponseBase.html index 84376a8d4..48dd43024 100644 --- a/docs/api/Titanium.Web.Proxy.Http.RequestResponseBase.html +++ b/docs/api/Titanium.Web.Proxy.Http.RequestResponseBase.html @@ -10,7 +10,7 @@ - + @@ -101,6 +101,9 @@
    Inherited Members
    Object.Equals(Object, Object)
    +
    + Object.ReferenceEquals(Object, Object) +
    Object.GetHashCode()
    @@ -110,9 +113,6 @@
    Inherited Members
    Object.MemberwiseClone()
    -
    - Object.ReferenceEquals(Object, Object) -
    Namespace: Titanium.Web.Proxy.Http
    Assembly: Titanium.Web.Proxy.dll
    @@ -127,7 +127,7 @@

    Properties Improve this Doc - View Source + View Source

    Body

    @@ -159,7 +159,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    BodyInternal

    @@ -190,7 +190,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    BodyString

    @@ -223,7 +223,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    ContentEncoding

    @@ -254,7 +254,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    ContentLength

    @@ -285,7 +285,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    ContentType

    @@ -316,7 +316,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    Encoding

    @@ -347,7 +347,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    HasBody

    @@ -378,7 +378,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    Headers

    @@ -409,7 +409,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    HeaderText

    @@ -440,7 +440,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    HttpVersion

    @@ -471,7 +471,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    IsBodyRead

    @@ -502,7 +502,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    IsChunked

    @@ -533,7 +533,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    KeepBody

    @@ -566,7 +566,7 @@

    Methods Improve this Doc - View Source + View Source

    ToString()

    @@ -604,7 +604,7 @@
    Overrides
    Improve this Doc
  • - View Source + View Source
  • diff --git a/docs/api/Titanium.Web.Proxy.Http.Response.html b/docs/api/Titanium.Web.Proxy.Http.Response.html index babc28e96..dbc95d536 100644 --- a/docs/api/Titanium.Web.Proxy.Http.Response.html +++ b/docs/api/Titanium.Web.Proxy.Http.Response.html @@ -10,7 +10,7 @@ - + @@ -143,6 +143,9 @@
    Inherited Members
    Object.Equals(Object, Object)
    +
    + Object.ReferenceEquals(Object, Object) +
    Object.GetHashCode()
    @@ -152,9 +155,6 @@
    Inherited Members
    Object.MemberwiseClone()
    -
    - Object.ReferenceEquals(Object, Object) -
    Namespace: Titanium.Web.Proxy.Http
    Assembly: Titanium.Web.Proxy.dll
    @@ -170,7 +170,7 @@

    Constructors Improve this Doc - View Source + View Source

    Response()

    @@ -186,7 +186,7 @@
    Declaration
    Improve this Doc - View Source + View Source

    Response(Byte[])

    @@ -254,7 +254,7 @@
    Overrides
    Improve this Doc - View Source + View Source

    HeaderText

    @@ -287,7 +287,7 @@
    Overrides
    Improve this Doc - View Source + View Source

    KeepAlive

    @@ -318,7 +318,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    StatusCode

    @@ -349,7 +349,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    StatusDescription

    @@ -386,7 +386,7 @@
    Property Value
    Improve this Doc
  • - View Source + View Source
  • diff --git a/docs/api/Titanium.Web.Proxy.Http.Responses.GenericResponse.html b/docs/api/Titanium.Web.Proxy.Http.Responses.GenericResponse.html index 45ba078f9..7067df9cb 100644 --- a/docs/api/Titanium.Web.Proxy.Http.Responses.GenericResponse.html +++ b/docs/api/Titanium.Web.Proxy.Http.Responses.GenericResponse.html @@ -10,7 +10,7 @@ - + @@ -155,6 +155,9 @@
    Inherited Members
    Object.Equals(Object, Object)
    +
    + Object.ReferenceEquals(Object, Object) +
    Object.GetHashCode()
    @@ -164,9 +167,6 @@
    Inherited Members
    Object.MemberwiseClone()
    -
    - Object.ReferenceEquals(Object, Object) -
    Namespace: Titanium.Web.Proxy.Http.Responses
    Assembly: Titanium.Web.Proxy.dll
    @@ -181,7 +181,7 @@

    Constructors Improve this Doc - View Source + View Source

    GenericResponse(Int32, String)

    @@ -219,7 +219,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    GenericResponse(HttpStatusCode)

    @@ -258,7 +258,7 @@
    Parameters
    Improve this Doc
  • - View Source + View Source
  • diff --git a/docs/api/Titanium.Web.Proxy.Http.Responses.OkResponse.html b/docs/api/Titanium.Web.Proxy.Http.Responses.OkResponse.html index 566168adb..28fea04a6 100644 --- a/docs/api/Titanium.Web.Proxy.Http.Responses.OkResponse.html +++ b/docs/api/Titanium.Web.Proxy.Http.Responses.OkResponse.html @@ -10,7 +10,7 @@ - + @@ -155,6 +155,9 @@
    Inherited Members
    Object.Equals(Object, Object)
    +
    + Object.ReferenceEquals(Object, Object) +
    Object.GetHashCode()
    @@ -164,9 +167,6 @@
    Inherited Members
    Object.MemberwiseClone()
    -
    - Object.ReferenceEquals(Object, Object) -
    Namespace: Titanium.Web.Proxy.Http.Responses
    Assembly: Titanium.Web.Proxy.dll
    diff --git a/docs/api/Titanium.Web.Proxy.Http.Responses.RedirectResponse.html b/docs/api/Titanium.Web.Proxy.Http.Responses.RedirectResponse.html index 2ecb66fc7..ef3ff3244 100644 --- a/docs/api/Titanium.Web.Proxy.Http.Responses.RedirectResponse.html +++ b/docs/api/Titanium.Web.Proxy.Http.Responses.RedirectResponse.html @@ -10,7 +10,7 @@ - + @@ -155,6 +155,9 @@
    Inherited Members
    Object.Equals(Object, Object)
    +
    + Object.ReferenceEquals(Object, Object) +
    Object.GetHashCode()
    @@ -164,9 +167,6 @@
    Inherited Members
    Object.MemberwiseClone()
    -
    - Object.ReferenceEquals(Object, Object) -
    Namespace: Titanium.Web.Proxy.Http.Responses
    Assembly: Titanium.Web.Proxy.dll
    diff --git a/docs/api/Titanium.Web.Proxy.Http.Responses.html b/docs/api/Titanium.Web.Proxy.Http.Responses.html index 07aeb7e4c..afa553379 100644 --- a/docs/api/Titanium.Web.Proxy.Http.Responses.html +++ b/docs/api/Titanium.Web.Proxy.Http.Responses.html @@ -10,7 +10,7 @@ - + diff --git a/docs/api/Titanium.Web.Proxy.Http.html b/docs/api/Titanium.Web.Proxy.Http.html index b1ef6016e..09c049518 100644 --- a/docs/api/Titanium.Web.Proxy.Http.html +++ b/docs/api/Titanium.Web.Proxy.Http.html @@ -10,7 +10,7 @@ - + diff --git a/docs/api/Titanium.Web.Proxy.Http2.Hpack.DynamicTable.html b/docs/api/Titanium.Web.Proxy.Http2.Hpack.DynamicTable.html index 14bb3dbf3..19267845d 100644 --- a/docs/api/Titanium.Web.Proxy.Http2.Hpack.DynamicTable.html +++ b/docs/api/Titanium.Web.Proxy.Http2.Hpack.DynamicTable.html @@ -10,7 +10,7 @@ - + @@ -92,12 +92,18 @@
    Inheritance
    Inherited Members
    +
    + Object.ToString() +
    Object.Equals(Object)
    Object.Equals(Object, Object)
    +
    + Object.ReferenceEquals(Object, Object) +
    Object.GetHashCode()
    @@ -107,12 +113,6 @@
    Inherited Members
    Object.MemberwiseClone()
    -
    - Object.ReferenceEquals(Object, Object) -
    -
    - Object.ToString() -
    Namespace: Titanium.Web.Proxy.Http2.Hpack
    Assembly: Titanium.Web.Proxy.dll
    @@ -127,7 +127,7 @@

    Constructors Improve this Doc - View Source + View Source

    DynamicTable(Int32)

    @@ -163,7 +163,7 @@

    Properties Improve this Doc - View Source + View Source

    Capacity

    @@ -195,7 +195,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    Size

    @@ -230,7 +230,7 @@

    Methods Improve this Doc - View Source + View Source

    Add(HttpHeader)

    @@ -268,7 +268,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    Clear()

    @@ -284,7 +284,7 @@
    Declaration
    Improve this Doc - View Source + View Source

    GetEntry(Int32)

    @@ -336,7 +336,7 @@
    Returns
    Improve this Doc - View Source + View Source

    Length()

    @@ -367,7 +367,7 @@
    Returns
    Improve this Doc - View Source + View Source

    Remove()

    @@ -398,7 +398,7 @@
    Returns
    Improve this Doc - View Source + View Source

    SetCapacity(Int32)

    diff --git a/docs/api/Titanium.Web.Proxy.Http2.Hpack.HpackUtil.IndexType.html b/docs/api/Titanium.Web.Proxy.Http2.Hpack.HpackUtil.IndexType.html index 1275815f5..116ea1f49 100644 --- a/docs/api/Titanium.Web.Proxy.Http2.Hpack.HpackUtil.IndexType.html +++ b/docs/api/Titanium.Web.Proxy.Http2.Hpack.HpackUtil.IndexType.html @@ -10,7 +10,7 @@ - + diff --git a/docs/api/Titanium.Web.Proxy.Http2.Hpack.HpackUtil.html b/docs/api/Titanium.Web.Proxy.Http2.Hpack.HpackUtil.html index 58a59436d..5d90c9c2f 100644 --- a/docs/api/Titanium.Web.Proxy.Http2.Hpack.HpackUtil.html +++ b/docs/api/Titanium.Web.Proxy.Http2.Hpack.HpackUtil.html @@ -10,7 +10,7 @@ - + @@ -92,12 +92,18 @@
    Inheritance
    Inherited Members
    +
    + Object.ToString() +
    Object.Equals(Object)
    Object.Equals(Object, Object)
    +
    + Object.ReferenceEquals(Object, Object) +
    Object.GetHashCode()
    @@ -107,12 +113,6 @@
    Inherited Members
    Object.MemberwiseClone()
    -
    - Object.ReferenceEquals(Object, Object) -
    -
    - Object.ToString() -
    Namespace: Titanium.Web.Proxy.Http2.Hpack
    Assembly: Titanium.Web.Proxy.dll
    diff --git a/docs/api/Titanium.Web.Proxy.Http2.Hpack.HuffmanDecoder.html b/docs/api/Titanium.Web.Proxy.Http2.Hpack.HuffmanDecoder.html index a42436efd..f50e49564 100644 --- a/docs/api/Titanium.Web.Proxy.Http2.Hpack.HuffmanDecoder.html +++ b/docs/api/Titanium.Web.Proxy.Http2.Hpack.HuffmanDecoder.html @@ -10,7 +10,7 @@ - + @@ -92,12 +92,18 @@
    Inheritance
    Inherited Members
    +
    + Object.ToString() +
    Object.Equals(Object)
    Object.Equals(Object, Object)
    +
    + Object.ReferenceEquals(Object, Object) +
    Object.GetHashCode()
    @@ -107,12 +113,6 @@
    Inherited Members
    Object.MemberwiseClone()
    -
    - Object.ReferenceEquals(Object, Object) -
    -
    - Object.ToString() -
    Namespace: Titanium.Web.Proxy.Http2.Hpack
    Assembly: Titanium.Web.Proxy.dll
    @@ -127,7 +127,7 @@

    Fields Improve this Doc - View Source + View Source

    Instance

    Huffman Decoder

    @@ -159,7 +159,7 @@

    Methods Improve this Doc - View Source + View Source

    Decode(Byte[])

    @@ -168,7 +168,7 @@

    Declaration
    -
    public string Decode(byte[] buf)
    +
    public ReadOnlyMemory<byte> Decode(byte[] buf)
    Parameters
    @@ -198,7 +198,7 @@
    Returns
    - + @@ -231,7 +231,7 @@
    Exceptions
    Improve this Doc
  • - View Source + View Source
  • diff --git a/docs/api/Titanium.Web.Proxy.Http2.Hpack.html b/docs/api/Titanium.Web.Proxy.Http2.Hpack.html index b391be209..e3ae9a8fb 100644 --- a/docs/api/Titanium.Web.Proxy.Http2.Hpack.html +++ b/docs/api/Titanium.Web.Proxy.Http2.Hpack.html @@ -10,7 +10,7 @@ - + @@ -87,24 +87,12 @@

    Classes

    -

    Decoder

    -

    DynamicTable

    -

    Encoder

    -

    HpackUtil

    HuffmanDecoder

    -

    HuffmanEncoder

    -
    -

    StaticTable

    -
    -

    Interfaces -

    -

    IHeaderListener

    -

    Enums

    HpackUtil.IndexType

    diff --git a/docs/api/Titanium.Web.Proxy.Models.ExplicitProxyEndPoint.html b/docs/api/Titanium.Web.Proxy.Models.ExplicitProxyEndPoint.html index 6d0d13347..3901692f9 100644 --- a/docs/api/Titanium.Web.Proxy.Models.ExplicitProxyEndPoint.html +++ b/docs/api/Titanium.Web.Proxy.Models.ExplicitProxyEndPoint.html @@ -10,7 +10,7 @@ - + @@ -107,12 +107,18 @@
    Inherited Members
    ProxyEndPoint.GenericCertificate
    +
    + Object.ToString() +
    Object.Equals(Object)
    Object.Equals(Object, Object)
    +
    + Object.ReferenceEquals(Object, Object) +
    Object.GetHashCode()
    @@ -122,12 +128,6 @@
    Inherited Members
    Object.MemberwiseClone()
    -
    - Object.ReferenceEquals(Object, Object) -
    -
    - Object.ToString() -
    Namespace: Titanium.Web.Proxy.Models
    Assembly: Titanium.Web.Proxy.dll
    @@ -142,7 +142,7 @@

    Constructors Improve this Doc - View Source + View Source

    ExplicitProxyEndPoint(IPAddress, Int32, Boolean)

    @@ -190,7 +190,7 @@

    Events Improve this Doc - View Source + View Source

    BeforeTunnelConnectRequest

    Intercept tunnel connect request. @@ -223,7 +223,7 @@

    Event Type
    Improve this Doc - View Source + View Source

    BeforeTunnelConnectResponse

    Intercept tunnel connect response. diff --git a/docs/api/Titanium.Web.Proxy.Models.ExternalProxy.html b/docs/api/Titanium.Web.Proxy.Models.ExternalProxy.html index ab0387c1b..f42626e77 100644 --- a/docs/api/Titanium.Web.Proxy.Models.ExternalProxy.html +++ b/docs/api/Titanium.Web.Proxy.Models.ExternalProxy.html @@ -10,7 +10,7 @@ - + @@ -91,33 +91,122 @@

    Inheritance
    Object
    ExternalProxy
    -
    -
    Inherited Members
    -
    - Object.Equals(Object) -
    -
    - Object.Equals(Object, Object) -
    -
    - Object.GetHashCode() -
    -
    - Object.GetType() -
    -
    - Object.MemberwiseClone() -
    -
    - Object.ReferenceEquals(Object, Object) -
    -
    Namespace: Titanium.Web.Proxy.Models
    Assembly: Titanium.Web.Proxy.dll
    Syntax
    -
    public class ExternalProxy
    +
    public class ExternalProxy : IExternalProxy
    +
    +

    Constructors +

    + + | + Improve this Doc + + + View Source + + +

    ExternalProxy()

    +

    Initializes a new instance of the ExternalProxy class.

    +
    +
    +
    Declaration
    +
    +
    public ExternalProxy()
    +
    + + | + Improve this Doc + + + View Source + + +

    ExternalProxy(String, Int32)

    +

    Initializes a new instance of the ExternalProxy class.

    +
    +
    +
    Declaration
    +
    +
    public ExternalProxy(string hostName, int port)
    +
    Parameters
    +
    StringReadOnlyMemory<Byte>

    the output stream for the compressed data

    + + + + + + + + + + + + + + + + + + + +
    TypeNameDescription
    StringhostName

    Name of the host.

    +
    Int32port

    The port.

    +
    + + | + Improve this Doc + + + View Source + + +

    ExternalProxy(String, Int32, String, String)

    +

    Initializes a new instance of the ExternalProxy class.

    +
    +
    +
    Declaration
    +
    +
    public ExternalProxy(string hostName, int port, string userName, string password)
    +
    +
    Parameters
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeNameDescription
    StringhostName

    Name of the host.

    +
    Int32port

    The port.

    +
    StringuserName

    Name of the user.

    +
    Stringpassword

    The password.

    +

    Properties

    @@ -156,7 +245,7 @@
    Property Value
    Improve this Doc
    - View Source + View Source

    HostName

    @@ -187,7 +276,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    Password

    @@ -218,7 +307,7 @@
    Property Value
    Improve this Doc - View Source + View Source

    Port

    @@ -244,6 +333,36 @@
    Property Value
    + + | + Improve this Doc + + + View Source + + +

    ProxyType

    +
    +
    +
    Declaration
    +
    +
    public ExternalProxyType ProxyType { get; set; }
    +
    +
    Property Value
    + + + + + + + + + + + + + +
    TypeDescription
    ExternalProxyType
    | Improve this Doc @@ -280,7 +399,7 @@
    Property Value
    Improve this Doc
    - View Source + View Source

    UserName

    @@ -313,7 +432,7 @@

    Methods Improve this Doc - View Source + View Source

    ToString()

    @@ -339,8 +458,6 @@
    Returns
    -
    Overrides
    -
    Object.ToString()
    diff --git a/docs/api/Titanium.Web.Proxy.Models.ExternalProxyType.html b/docs/api/Titanium.Web.Proxy.Models.ExternalProxyType.html new file mode 100644 index 000000000..fcf02d616 --- /dev/null +++ b/docs/api/Titanium.Web.Proxy.Models.ExternalProxyType.html @@ -0,0 +1,162 @@ + + + + + + + + Enum ExternalProxyType + | Titanium Web Proxy + + + + + + + + + + + + + + + +
    +
    + +
    +
    +
    + + + + + +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
      +
    • +
    +
    +
    +
    +
    + +
    +
    +
    +

    +
    +
      +
      +
      +
      + +
      + Show / Hide Table of Contents +
      +
      +
      +
      +
      +
      +
      + + +

      Enum ExternalProxyType +

      +
      +
      +
      Namespace: Titanium.Web.Proxy.Models
      +
      Assembly: Titanium.Web.Proxy.dll
      +
      Syntax
      +
      +
      public enum ExternalProxyType
      +
      +

      Fields +

      + + + + + + + + + + + + + + + + + + + + + +
      NameDescription
      Http

      A HTTP/HTTPS proxy server.

      +
      Socks4

      A SOCKS4[A] proxy server.

      +
      Socks5

      A SOCKS5 proxy server.

      +
      +
      +
      + +
      +
      +
      +
        +
      • + Improve this Doc +
      • +
      • + View Source +
      • +
      +
      +
      + +
      +
      +
      +
      +
      + +
      +
      +
      +
      + + Back to top + + + Generated by DocFX +
      +
      +
      +
      + + + + + + diff --git a/docs/api/Titanium.Web.Proxy.Models.HttpHeader.html b/docs/api/Titanium.Web.Proxy.Models.HttpHeader.html index 94e24c176..ad351e844 100644 --- a/docs/api/Titanium.Web.Proxy.Models.HttpHeader.html +++ b/docs/api/Titanium.Web.Proxy.Models.HttpHeader.html @@ -10,7 +10,7 @@ - + @@ -99,6 +99,9 @@
      Inherited Members
      Object.Equals(Object, Object)
      +
      + Object.ReferenceEquals(Object, Object) +
      Object.GetHashCode()
      @@ -108,9 +111,6 @@
      Inherited Members
      Object.MemberwiseClone()
      -
      - Object.ReferenceEquals(Object, Object) -
      Namespace: Titanium.Web.Proxy.Models
      Assembly: Titanium.Web.Proxy.dll
      @@ -125,7 +125,7 @@

      Constructors Improve this Doc - View Source + View Source

      HttpHeader(String, String)

      @@ -160,68 +160,58 @@
      Parameters
      +

      Fields +

      | - Improve this Doc + Improve this Doc - View Source + View Source - -

      HttpHeader(String, String, Boolean)

      -
      +

      HttpHeaderOverhead

      +

      HPACK: Header Compression for HTTP/2 +Section 4.1. Calculating Table Size +The additional 32 octets account for an estimated overhead associated with an entry.

      +
      Declaration
      -
      protected HttpHeader(string name, string value, bool headerEntry)
      +
      public const int HttpHeaderOverhead = 32
      -
      Parameters
      +
      Field Value
      - - - - - - - - - - - - - +
      TypeName Description
      Stringname
      Stringvalue
      BooleanheaderEntryInt32
      -

      Fields +

      Properties

      | - Improve this Doc + Improve this Doc - View Source + View Source -

      HttpHeaderOverhead

      -

      HPACK: Header Compression for HTTP/2 -Section 4.1. Calculating Table Size -The additional 32 octets account for an estimated overhead associated with an entry.

      -
      + +

      Encoding

      +
      Declaration
      -
      public const int HttpHeaderOverhead = 32
      +
      public static Encoding Encoding { get; }
      -
      Field Value
      +
      Property Value
      @@ -231,19 +221,17 @@
      Field Value
      - +
      Int32Encoding
      -

      Properties -

      | Improve this Doc - View Source + View Source

      Name

      @@ -274,7 +262,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      Size

      @@ -304,7 +292,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      Value

      @@ -313,7 +301,7 @@

      Declaration
      -
      public string Value { get; set; }
      +
      public string Value { get; }
      Property Value
      @@ -332,64 +320,12 @@
      Property Value

      Methods

      - - | - Improve this Doc - - - View Source - - -

      SizeOf(String, String)

      -
      -
      -
      Declaration
      -
      -
      public static int SizeOf(string name, string value)
      -
      -
      Parameters
      - - - - - - - - - - - - - - - - - - - - -
      TypeNameDescription
      Stringname
      Stringvalue
      -
      Returns
      - - - - - - - - - - - - - -
      TypeDescription
      Int32
      | Improve this Doc - View Source + View Source

      ToString()

      @@ -428,7 +364,7 @@
      Overrides
      Improve this Doc
    • - View Source + View Source
    • diff --git a/docs/api/Titanium.Web.Proxy.Models.ProxyAuthenticationContext.html b/docs/api/Titanium.Web.Proxy.Models.ProxyAuthenticationContext.html index 2fee0cb67..33eb7b702 100644 --- a/docs/api/Titanium.Web.Proxy.Models.ProxyAuthenticationContext.html +++ b/docs/api/Titanium.Web.Proxy.Models.ProxyAuthenticationContext.html @@ -10,7 +10,7 @@ - + @@ -93,12 +93,18 @@
      Inheritance
      Inherited Members
      +
      + Object.ToString() +
      Object.Equals(Object)
      Object.Equals(Object, Object)
      +
      + Object.ReferenceEquals(Object, Object) +
      Object.GetHashCode()
      @@ -108,12 +114,6 @@
      Inherited Members
      Object.MemberwiseClone()
      -
      - Object.ReferenceEquals(Object, Object) -
      -
      - Object.ToString() -
      Namespace: Titanium.Web.Proxy.Models
      Assembly: Titanium.Web.Proxy.dll
      diff --git a/docs/api/Titanium.Web.Proxy.Models.ProxyAuthenticationResult.html b/docs/api/Titanium.Web.Proxy.Models.ProxyAuthenticationResult.html index c8e4a00a3..dc7dc70f1 100644 --- a/docs/api/Titanium.Web.Proxy.Models.ProxyAuthenticationResult.html +++ b/docs/api/Titanium.Web.Proxy.Models.ProxyAuthenticationResult.html @@ -10,7 +10,7 @@ - + diff --git a/docs/api/Titanium.Web.Proxy.Models.ProxyEndPoint.html b/docs/api/Titanium.Web.Proxy.Models.ProxyEndPoint.html index 333371a0e..f2bed6cf9 100644 --- a/docs/api/Titanium.Web.Proxy.Models.ProxyEndPoint.html +++ b/docs/api/Titanium.Web.Proxy.Models.ProxyEndPoint.html @@ -10,7 +10,7 @@ - + @@ -91,16 +91,21 @@
      Inheritance
      Object
      ProxyEndPoint
      ExplicitProxyEndPoint
      -
      TransparentProxyEndPoint
      Inherited Members
      +
      + Object.ToString() +
      Object.Equals(Object)
      Object.Equals(Object, Object)
      +
      + Object.ReferenceEquals(Object, Object) +
      Object.GetHashCode()
      @@ -110,12 +115,6 @@
      Inherited Members
      Object.MemberwiseClone()
      -
      - Object.ReferenceEquals(Object, Object) -
      -
      - Object.ToString() -
      Namespace: Titanium.Web.Proxy.Models
      Assembly: Titanium.Web.Proxy.dll
      diff --git a/docs/api/Titanium.Web.Proxy.Models.ProxyProtocolType.html b/docs/api/Titanium.Web.Proxy.Models.ProxyProtocolType.html index 71c17cf26..bc9900ce2 100644 --- a/docs/api/Titanium.Web.Proxy.Models.ProxyProtocolType.html +++ b/docs/api/Titanium.Web.Proxy.Models.ProxyProtocolType.html @@ -10,7 +10,7 @@ - + diff --git a/docs/api/Titanium.Web.Proxy.Models.TransparentProxyEndPoint.html b/docs/api/Titanium.Web.Proxy.Models.TransparentProxyEndPoint.html index 15c4c93ec..f60879cf5 100644 --- a/docs/api/Titanium.Web.Proxy.Models.TransparentProxyEndPoint.html +++ b/docs/api/Titanium.Web.Proxy.Models.TransparentProxyEndPoint.html @@ -10,7 +10,7 @@ - + @@ -90,50 +90,13 @@

      Inheritance
      Object
      -
      ProxyEndPoint
      -
      TransparentProxyEndPoint
      - -
      -
      Inherited Members
      -
      - ProxyEndPoint.IpAddress -
      -
      - ProxyEndPoint.Port -
      -
      - ProxyEndPoint.DecryptSsl -
      -
      - ProxyEndPoint.GenericCertificate -
      -
      - Object.Equals(Object) -
      -
      - Object.Equals(Object, Object) -
      -
      - Object.GetHashCode() -
      -
      - Object.GetType() -
      -
      - Object.MemberwiseClone() -
      -
      - Object.ReferenceEquals(Object, Object) -
      -
      - Object.ToString() -
      +
      TransparentProxyEndPoint
      Namespace: Titanium.Web.Proxy.Models
      Assembly: Titanium.Web.Proxy.dll
      Syntax
      -
      public class TransparentProxyEndPoint : ProxyEndPoint
      +
      public class TransparentProxyEndPoint : TransparentBaseProxyEndPoint

      Constructors

      @@ -142,7 +105,7 @@

      Constructors Improve this Doc - View Source + View Source

      TransparentProxyEndPoint(IPAddress, Int32, Boolean)

      @@ -190,7 +153,7 @@

      Properties Improve this Doc - View Source + View Source

      GenericCertificateName

      @@ -200,7 +163,7 @@

      Declaration
      -
      public string GenericCertificateName { get; set; }
      +
      public override string GenericCertificateName { get; set; }
      Property Value
      @@ -224,7 +187,7 @@

      Events Improve this Doc - View Source + View Source

      BeforeSslAuthenticate

      Before Ssl authentication this event is fired.

      @@ -260,7 +223,7 @@
      Event Type
      Improve this Doc
    • - View Source + View Source
    • diff --git a/docs/api/Titanium.Web.Proxy.Models.html b/docs/api/Titanium.Web.Proxy.Models.html index cd236b61a..cc7941c64 100644 --- a/docs/api/Titanium.Web.Proxy.Models.html +++ b/docs/api/Titanium.Web.Proxy.Models.html @@ -10,7 +10,7 @@ - + @@ -109,6 +109,8 @@

      Enums

      +

      ExternalProxyType

      +

      ProxyAuthenticationResult

      ProxyProtocolType

      diff --git a/docs/api/Titanium.Web.Proxy.Network.CertificateEngine.html b/docs/api/Titanium.Web.Proxy.Network.CertificateEngine.html index 091ef3e51..54c74e7b1 100644 --- a/docs/api/Titanium.Web.Proxy.Network.CertificateEngine.html +++ b/docs/api/Titanium.Web.Proxy.Network.CertificateEngine.html @@ -10,7 +10,7 @@ - + diff --git a/docs/api/Titanium.Web.Proxy.Network.CertificateManager.html b/docs/api/Titanium.Web.Proxy.Network.CertificateManager.html index e085c4660..80af9d4ed 100644 --- a/docs/api/Titanium.Web.Proxy.Network.CertificateManager.html +++ b/docs/api/Titanium.Web.Proxy.Network.CertificateManager.html @@ -10,7 +10,7 @@ - + @@ -97,12 +97,18 @@
      Implements
      Inherited Members
      +
      + Object.ToString() +
      Object.Equals(Object)
      Object.Equals(Object, Object)
      +
      + Object.ReferenceEquals(Object, Object) +
      Object.GetHashCode()
      @@ -112,12 +118,6 @@
      Inherited Members
      Object.MemberwiseClone()
      -
      - Object.ReferenceEquals(Object, Object) -
      -
      - Object.ToString() -
      Namespace: Titanium.Web.Proxy.Network
      Assembly: Titanium.Web.Proxy.dll
      @@ -132,7 +132,7 @@

      Properties Improve this Doc - View Source + View Source

      CertificateCacheTimeOutMinutes

      @@ -163,7 +163,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      CertificateEngine

      @@ -196,7 +196,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      CertificateStorage

      @@ -229,7 +229,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      OverwritePfxFile

      @@ -261,7 +261,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      PfxFilePath

      @@ -296,7 +296,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      PfxPassword

      @@ -328,7 +328,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      RootCertificate

      @@ -359,7 +359,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      RootCertificateIssuerName

      @@ -391,7 +391,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      RootCertificateName

      @@ -426,7 +426,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      SaveFakeCertificates

      @@ -458,7 +458,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      StorageFlag

      @@ -491,7 +491,7 @@

      Methods Improve this Doc - View Source + View Source

      ClearRootCertificate()

      @@ -507,7 +507,7 @@
      Declaration
      Improve this Doc - View Source + View Source

      CreateRootCertificate(Boolean)

      @@ -557,7 +557,7 @@
      Returns
      Improve this Doc - View Source + View Source

      CreateServerCertificate(String)

      @@ -605,7 +605,7 @@
      Returns
      Improve this Doc - View Source + View Source

      Dispose()

      @@ -621,7 +621,7 @@
      Declaration
      Improve this Doc - View Source + View Source

      EnsureRootCertificate()

      @@ -638,7 +638,7 @@
      Declaration
      Improve this Doc - View Source + View Source

      EnsureRootCertificate(Boolean, Boolean, Boolean)

      @@ -688,7 +688,7 @@
      Parameters
      Improve this Doc - View Source + View Source

      IsRootCertificateMachineTrusted()

      @@ -719,7 +719,7 @@
      Returns
      Improve this Doc - View Source + View Source

      IsRootCertificateUserTrusted()

      @@ -750,7 +750,7 @@
      Returns
      Improve this Doc - View Source + View Source

      LoadRootCertificate()

      @@ -781,7 +781,7 @@
      Returns
      Improve this Doc - View Source + View Source

      LoadRootCertificate(String, String, Boolean, X509KeyStorageFlags)

      @@ -850,7 +850,7 @@
      Returns
      Improve this Doc - View Source + View Source

      RemoveTrustedRootCertificate(Boolean)

      @@ -885,7 +885,7 @@
      Parameters
      Improve this Doc - View Source + View Source

      RemoveTrustedRootCertificateAsAdmin(Boolean)

      @@ -934,7 +934,7 @@
      Returns
      Improve this Doc - View Source + View Source

      TrustRootCertificate(Boolean)

      @@ -968,7 +968,7 @@
      Parameters
      Improve this Doc - View Source + View Source

      TrustRootCertificateAsAdmin(Boolean)

      diff --git a/docs/api/Titanium.Web.Proxy.Network.html b/docs/api/Titanium.Web.Proxy.Network.html index ad2361aef..a4aff05f5 100644 --- a/docs/api/Titanium.Web.Proxy.Network.html +++ b/docs/api/Titanium.Web.Proxy.Network.html @@ -10,7 +10,7 @@ - + diff --git a/docs/api/Titanium.Web.Proxy.ProxyServer.html b/docs/api/Titanium.Web.Proxy.ProxyServer.html index d733700a9..e83d17f78 100644 --- a/docs/api/Titanium.Web.Proxy.ProxyServer.html +++ b/docs/api/Titanium.Web.Proxy.ProxyServer.html @@ -10,7 +10,7 @@ - + @@ -98,12 +98,18 @@
      Implements
      Inherited Members
      +
      + Object.ToString() +
      Object.Equals(Object)
      Object.Equals(Object, Object)
      +
      + Object.ReferenceEquals(Object, Object) +
      Object.GetHashCode()
      @@ -113,12 +119,6 @@
      Inherited Members
      Object.MemberwiseClone()
      -
      - Object.ReferenceEquals(Object, Object) -
      -
      - Object.ToString() -
      Namespace: Titanium.Web.Proxy
      Assembly: Titanium.Web.Proxy.dll
      @@ -133,7 +133,7 @@

      Constructors Improve this Doc - View Source + View Source

      ProxyServer(Boolean, Boolean, Boolean)

      @@ -181,7 +181,7 @@
      Parameters
      Improve this Doc - View Source + View Source

      ProxyServer(String, String, Boolean, Boolean, Boolean)

      @@ -243,13 +243,14 @@

      Properties Improve this Doc - View Source + View Source

      BufferPool

      The buffer pool used throughout this proxy instance. Set custom implementations by implementing this interface. -By default this uses DefaultBufferPool implementation available in StreamExtended library package.

      +By default this uses DefaultBufferPool implementation available in StreamExtended library package. +Buffer size should be at least 10 bytes.

      Declaration
      @@ -276,7 +277,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      CertificateManager

      @@ -307,7 +308,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      CheckCertificateRevocation

      @@ -339,7 +340,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      ClientConnectionCount

      @@ -370,7 +371,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      ConnectionTimeOutSeconds

      @@ -398,12 +399,76 @@
      Property Value
      + + | + Improve this Doc + + + View Source + + +

      ConnectTimeOutSeconds

      +

      Seconds server connection are to wait for connection to be established. +Default value is 20 seconds.

      +
      +
      +
      Declaration
      +
      +
      public int ConnectTimeOutSeconds { get; set; }
      +
      +
      Property Value
      + + + + + + + + + + + + + +
      TypeDescription
      Int32
      + + | + Improve this Doc + + + View Source + + +

      CustomUpStreamProxyFailureFunc

      +

      A callback to provide a chance for an upstream proxy failure to be handled by a new upstream proxy. +User should return the ExternalProxy object with valid credentials or null.

      +
      +
      +
      Declaration
      +
      +
      public Func<SessionEventArgsBase, Task<IExternalProxy?>> CustomUpStreamProxyFailureFunc { get; set; }
      +
      +
      Property Value
      + + + + + + + + + + + + + +
      TypeDescription
      Func<SessionEventArgsBase, Task<Nullable<IExternalProxy>>>
      | Improve this Doc - View Source + View Source

      Enable100ContinueBehaviour

      @@ -436,7 +501,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      EnableConnectionPool

      @@ -468,7 +533,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      EnableHttp2

      @@ -504,7 +569,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      EnableTcpServerConnectionPrefetch

      @@ -540,7 +605,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      EnableWinAuth

      @@ -575,7 +640,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      ExceptionFunc

      @@ -606,7 +671,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      ForwardToUpstreamGateway

      @@ -638,7 +703,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      GetCustomUpStreamProxyFunc

      @@ -648,7 +713,7 @@

      Declaration
      -
      public Func<SessionEventArgsBase, Task<ExternalProxy>> GetCustomUpStreamProxyFunc { get; set; }
      +
      public Func<SessionEventArgsBase, Task<IExternalProxy?>> GetCustomUpStreamProxyFunc { get; set; }
      Property Value
      @@ -660,7 +725,7 @@
      Property Value
      - + @@ -670,7 +735,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      MaxCachedConnections

      @@ -703,7 +768,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      NoDelay

      @@ -735,7 +800,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      ProxyAuthenticationRealm

      @@ -766,7 +831,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      ProxyAuthenticationSchemes

      @@ -798,7 +863,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      ProxyBasicAuthenticateFunc

      @@ -831,7 +896,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      ProxyEndPoints

      @@ -862,7 +927,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      ProxyRunning

      @@ -893,7 +958,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      ProxySchemeAuthenticateFunc

      @@ -926,7 +991,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      ReuseSocket

      @@ -958,7 +1023,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      ServerConnectionCount

      @@ -989,7 +1054,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      SupportedSslProtocols

      @@ -1020,7 +1085,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      TcpTimeWaitSeconds

      @@ -1052,7 +1117,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      ThreadPoolWorkerThread

      @@ -1083,7 +1148,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      UpStreamEndPoint

      @@ -1115,7 +1180,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      UpStreamHttpProxy

      @@ -1124,7 +1189,7 @@

      Declaration
      -
      public ExternalProxy UpStreamHttpProxy { get; set; }
      +
      public IExternalProxy? UpStreamHttpProxy { get; set; }
      Property Value
      Func<SessionEventArgsBase, Task<ExternalProxy>>Func<SessionEventArgsBase, Task<Nullable<IExternalProxy>>>
      @@ -1136,7 +1201,7 @@
      Property Value
      - + @@ -1146,7 +1211,7 @@
      Property Value
      Improve this Doc - View Source + View Source

      UpStreamHttpsProxy

      @@ -1155,7 +1220,7 @@

      Declaration
      -
      public ExternalProxy UpStreamHttpsProxy { get; set; }
      +
      public IExternalProxy? UpStreamHttpsProxy { get; set; }
      Property Value
      ExternalProxyNullable<IExternalProxy>
      @@ -1167,7 +1232,7 @@
      Property Value
      - + @@ -1179,7 +1244,7 @@

      Methods Improve this Doc - View Source + View Source

      AddEndPoint(ProxyEndPoint)

      @@ -1213,7 +1278,7 @@
      Parameters
      Improve this Doc - View Source + View Source

      DisableAllSystemProxies()

      @@ -1229,7 +1294,7 @@
      Declaration
      Improve this Doc - View Source + View Source

      DisableSystemHttpProxy()

      @@ -1245,7 +1310,7 @@
      Declaration
      Improve this Doc - View Source + View Source

      DisableSystemHttpsProxy()

      @@ -1261,7 +1326,7 @@
      Declaration
      Improve this Doc - View Source + View Source

      DisableSystemProxy(ProxyProtocolType)

      @@ -1294,7 +1359,7 @@
      Parameters
      Improve this Doc - View Source + View Source

      Dispose()

      @@ -1310,7 +1375,7 @@
      Declaration
      Improve this Doc - View Source + View Source

      RemoveEndPoint(ProxyEndPoint)

      @@ -1345,7 +1410,7 @@
      Parameters
      Improve this Doc - View Source + View Source

      RestoreOriginalProxySettings()

      @@ -1361,7 +1426,7 @@
      Declaration
      Improve this Doc - View Source + View Source

      SetAsSystemHttpProxy(ExplicitProxyEndPoint)

      @@ -1395,7 +1460,7 @@
      Parameters
      Improve this Doc - View Source + View Source

      SetAsSystemHttpsProxy(ExplicitProxyEndPoint)

      @@ -1429,7 +1494,7 @@
      Parameters
      Improve this Doc - View Source + View Source

      SetAsSystemProxy(ExplicitProxyEndPoint, ProxyProtocolType)

      @@ -1469,7 +1534,7 @@
      Parameters
      Improve this Doc - View Source + View Source

      Start()

      @@ -1485,7 +1550,7 @@
      Declaration
      Improve this Doc - View Source + View Source

      Stop()

      @@ -1503,7 +1568,7 @@

      Events Improve this Doc - View Source + View Source

      AfterResponse

      Intercept after response event from server.

      @@ -1533,7 +1598,7 @@
      Event Type
      Improve this Doc - View Source + View Source

      BeforeRequest

      Intercept request event to server.

      @@ -1563,7 +1628,7 @@
      Event Type
      Improve this Doc - View Source + View Source

      BeforeResponse

      Intercept response event from server.

      @@ -1593,7 +1658,7 @@
      Event Type
      Improve this Doc - View Source + View Source

      ClientCertificateSelectionCallback

      Event to override client certificate selection during mutual SSL authentication.

      @@ -1623,7 +1688,7 @@
      Event Type
      Improve this Doc - View Source + View Source

      ClientConnectionCountChanged

      Event occurs when client connection count changed.

      @@ -1653,7 +1718,7 @@
      Event Type
      Improve this Doc - View Source + View Source

      OnClientConnectionCreate

      Customize TcpClient used for client connection upon create.

      @@ -1661,7 +1726,7 @@

      Declaration
      -
      public event AsyncEventHandler<TcpClient> OnClientConnectionCreate
      +
      public event AsyncEventHandler<Socket> OnClientConnectionCreate
      Event Type
      ExternalProxyNullable<IExternalProxy>
      @@ -1673,7 +1738,7 @@
      Event Type
      - + @@ -1683,7 +1748,7 @@
      Event Type
      Improve this Doc - View Source + View Source

      OnServerConnectionCreate

      Customize TcpClient used for server connection upon create.

      @@ -1691,7 +1756,7 @@

      Declaration
      -
      public event AsyncEventHandler<TcpClient> OnServerConnectionCreate
      +
      public event AsyncEventHandler<Socket> OnServerConnectionCreate
      Event Type
      AsyncEventHandler<TcpClient>AsyncEventHandler<Socket>
      @@ -1703,7 +1768,7 @@
      Event Type
      - + @@ -1713,7 +1778,7 @@
      Event Type
      Improve this Doc - View Source + View Source

      ServerCertificateValidationCallback

      Event to override the default verification logic of remote SSL certificate received during authentication.

      @@ -1743,7 +1808,7 @@
      Event Type
      Improve this Doc - View Source + View Source

      ServerConnectionCountChanged

      Event occurs when server connection count changed.

      diff --git a/docs/api/Titanium.Web.Proxy.html b/docs/api/Titanium.Web.Proxy.html index 9c2e6e019..822d804d5 100644 --- a/docs/api/Titanium.Web.Proxy.html +++ b/docs/api/Titanium.Web.Proxy.html @@ -10,7 +10,7 @@ - + diff --git a/docs/api/toc.html b/docs/api/toc.html index 75ffda224..705a256d5 100644 --- a/docs/api/toc.html +++ b/docs/api/toc.html @@ -4,6 +4,7 @@
      +
      @@ -142,15 +143,9 @@ Titanium.Web.Proxy.Http2.Hpack
        -
      • - Decoder -
      • DynamicTable
      • -
      • - Encoder -
      • HpackUtil
      • @@ -160,15 +155,6 @@
      • HuffmanDecoder
      • -
      • - HuffmanEncoder -
      • -
      • - IHeaderListener -
      • -
      • - StaticTable -
    • @@ -182,6 +168,9 @@
    • ExternalProxy
    • +
    • + ExternalProxyType +
    • HttpHeader
    • diff --git a/docs/index.json b/docs/index.json index 4e864a176..0f395cfdf 100644 --- a/docs/index.json +++ b/docs/index.json @@ -7,17 +7,17 @@ "api/Titanium.Web.Proxy.EventArguments.BeforeSslAuthenticateEventArgs.html": { "href": "api/Titanium.Web.Proxy.EventArguments.BeforeSslAuthenticateEventArgs.html", "title": "Class BeforeSslAuthenticateEventArgs | Titanium Web Proxy", - "keywords": "Class BeforeSslAuthenticateEventArgs This is used in transparent endpoint before authenticating client. Inheritance Object EventArgs BeforeSslAuthenticateEventArgs Inherited Members EventArgs.Empty Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Titanium.Web.Proxy.EventArguments Assembly : Titanium.Web.Proxy.dll Syntax public class BeforeSslAuthenticateEventArgs : EventArgs Properties | Improve this Doc View Source DecryptSsl 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. Declaration public bool DecryptSsl { get; set; } Property Value Type Description Boolean | Improve this Doc View Source SniHostName The server name indication hostname if available. Otherwise the generic certificate hostname of TransparentEndPoint. Declaration public string SniHostName { get; } Property Value Type Description String Methods | Improve this Doc View Source TerminateSession() Terminate the request abruptly by closing client/server connections. Declaration public void TerminateSession()" + "keywords": "Class BeforeSslAuthenticateEventArgs This is used in transparent endpoint before authenticating client. Inheritance Object BeforeSslAuthenticateEventArgs Namespace : Titanium.Web.Proxy.EventArguments Assembly : Titanium.Web.Proxy.dll Syntax public class BeforeSslAuthenticateEventArgs : ProxyEventArgsBase Properties | Improve this Doc View Source DecryptSsl 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. Declaration public bool DecryptSsl { get; set; } Property Value Type Description Boolean | Improve this Doc View Source SniHostName The server name indication hostname if available. Otherwise the generic certificate hostname of TransparentEndPoint. Declaration public string SniHostName { get; } Property Value Type Description String Methods | Improve this Doc View Source TerminateSession() Terminate the request abruptly by closing client/server connections. Declaration public void TerminateSession()" }, "api/Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.html": { "href": "api/Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.html", "title": "Class CertificateSelectionEventArgs | Titanium Web Proxy", - "keywords": "Class CertificateSelectionEventArgs An argument passed on to user for client certificate selection during mutual SSL authentication. Inheritance Object EventArgs CertificateSelectionEventArgs Inherited Members EventArgs.Empty Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Titanium.Web.Proxy.EventArguments Assembly : Titanium.Web.Proxy.dll Syntax public class CertificateSelectionEventArgs : EventArgs Properties | Improve this Doc View Source AcceptableIssuers Acceptable issuers as listed by remote server. Declaration public string[] AcceptableIssuers { get; } Property Value Type Description String [] | Improve this Doc View Source ClientCertificate Client Certificate we selected. Set this value to override. Declaration public X509Certificate ClientCertificate { get; set; } Property Value Type Description X509Certificate | Improve this Doc View Source LocalCertificates Local certificates in store with matching issuers requested by TargetHost website. Declaration public X509CertificateCollection LocalCertificates { get; } Property Value Type Description X509CertificateCollection | Improve this Doc View Source RemoteCertificate Certificate of the remote server. Declaration public X509Certificate RemoteCertificate { get; } Property Value Type Description X509Certificate | Improve this Doc View Source Sender The proxy server instance. Declaration public object Sender { get; } Property Value Type Description Object | Improve this Doc View Source TargetHost The remote hostname to which we are authenticating against. Declaration public string TargetHost { get; } Property Value Type Description String" + "keywords": "Class CertificateSelectionEventArgs An argument passed on to user for client certificate selection during mutual SSL authentication. Inheritance Object CertificateSelectionEventArgs Namespace : Titanium.Web.Proxy.EventArguments Assembly : Titanium.Web.Proxy.dll Syntax public class CertificateSelectionEventArgs : ProxyEventArgsBase Constructors | Improve this Doc View Source CertificateSelectionEventArgs(SessionEventArgsBase, String, X509CertificateCollection, X509Certificate, String[]) Declaration public CertificateSelectionEventArgs(SessionEventArgsBase session, string targetHost, X509CertificateCollection localCertificates, X509Certificate remoteCertificate, string[] acceptableIssuers) Parameters Type Name Description SessionEventArgsBase session String targetHost X509CertificateCollection localCertificates X509Certificate remoteCertificate String [] acceptableIssuers Properties | Improve this Doc View Source AcceptableIssuers Acceptable issuers as listed by remote server. Declaration public string[] AcceptableIssuers { get; } Property Value Type Description String [] | Improve this Doc View Source ClientCertificate Client Certificate we selected. Set this value to override. Declaration public X509Certificate ClientCertificate { get; set; } Property Value Type Description X509Certificate | Improve this Doc View Source LocalCertificates Local certificates in store with matching issuers requested by TargetHost website. Declaration public X509CertificateCollection LocalCertificates { get; } Property Value Type Description X509CertificateCollection | Improve this Doc View Source RemoteCertificate Certificate of the remote server. Declaration public X509Certificate RemoteCertificate { get; } Property Value Type Description X509Certificate | Improve this Doc View Source Session Declaration public SessionEventArgsBase Session { get; } Property Value Type Description SessionEventArgsBase The session. | Improve this Doc View Source TargetHost The remote hostname to which we are authenticating against. Declaration public string TargetHost { get; } Property Value Type Description String" }, "api/Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.html": { "href": "api/Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.html", "title": "Class CertificateValidationEventArgs | Titanium Web Proxy", - "keywords": "Class CertificateValidationEventArgs An argument passed on to the user for validating the server certificate during SSL authentication. Inheritance Object EventArgs CertificateValidationEventArgs Inherited Members EventArgs.Empty Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Titanium.Web.Proxy.EventArguments Assembly : Titanium.Web.Proxy.dll Syntax public class CertificateValidationEventArgs : EventArgs Properties | Improve this Doc View Source Certificate Server certificate. Declaration public X509Certificate Certificate { get; } Property Value Type Description X509Certificate | Improve this Doc View Source Chain Certificate chain. Declaration public X509Chain Chain { get; } Property Value Type Description X509Chain | Improve this Doc View Source IsValid Is the given server certificate valid? Declaration public bool IsValid { get; set; } Property Value Type Description Boolean | Improve this Doc View Source SslPolicyErrors SSL policy errors. Declaration public SslPolicyErrors SslPolicyErrors { get; } Property Value Type Description SslPolicyErrors" + "keywords": "Class CertificateValidationEventArgs An argument passed on to the user for validating the server certificate during SSL authentication. Inheritance Object CertificateValidationEventArgs Namespace : Titanium.Web.Proxy.EventArguments Assembly : Titanium.Web.Proxy.dll Syntax public class CertificateValidationEventArgs : ProxyEventArgsBase Constructors | Improve this Doc View Source CertificateValidationEventArgs(SessionEventArgsBase, X509Certificate, X509Chain, SslPolicyErrors) Declaration public CertificateValidationEventArgs(SessionEventArgsBase session, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) Parameters Type Name Description SessionEventArgsBase session X509Certificate certificate X509Chain chain SslPolicyErrors sslPolicyErrors Properties | Improve this Doc View Source Certificate Server certificate. Declaration public X509Certificate Certificate { get; } Property Value Type Description X509Certificate | Improve this Doc View Source Chain Certificate chain. Declaration public X509Chain Chain { get; } Property Value Type Description X509Chain | Improve this Doc View Source IsValid Is the given server certificate valid? Declaration public bool IsValid { get; set; } Property Value Type Description Boolean | Improve this Doc View Source Session Declaration public SessionEventArgsBase Session { get; } Property Value Type Description SessionEventArgsBase The session. | Improve this Doc View Source SslPolicyErrors SSL policy errors. Declaration public SslPolicyErrors SslPolicyErrors { get; } Property Value Type Description SslPolicyErrors" }, "api/Titanium.Web.Proxy.EventArguments.html": { "href": "api/Titanium.Web.Proxy.EventArguments.html", @@ -27,22 +27,22 @@ "api/Titanium.Web.Proxy.EventArguments.MultipartRequestPartSentEventArgs.html": { "href": "api/Titanium.Web.Proxy.EventArguments.MultipartRequestPartSentEventArgs.html", "title": "Class MultipartRequestPartSentEventArgs | Titanium Web Proxy", - "keywords": "Class MultipartRequestPartSentEventArgs Class that wraps the multipart sent request arguments. Inheritance Object EventArgs MultipartRequestPartSentEventArgs Inherited Members EventArgs.Empty Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Titanium.Web.Proxy.EventArguments Assembly : Titanium.Web.Proxy.dll Syntax public class MultipartRequestPartSentEventArgs : EventArgs Properties | Improve this Doc View Source Boundary Boundary. Declaration public string Boundary { get; } Property Value Type Description String | Improve this Doc View Source Headers The header collection. Declaration public HeaderCollection Headers { get; } Property Value Type Description HeaderCollection" + "keywords": "Class MultipartRequestPartSentEventArgs Class that wraps the multipart sent request arguments. Inheritance Object MultipartRequestPartSentEventArgs Namespace : Titanium.Web.Proxy.EventArguments Assembly : Titanium.Web.Proxy.dll Syntax public class MultipartRequestPartSentEventArgs : ProxyEventArgsBase Properties | Improve this Doc View Source Boundary Boundary. Declaration public string Boundary { get; } Property Value Type Description String | Improve this Doc View Source Headers The header collection. Declaration public HeaderCollection Headers { get; } Property Value Type Description HeaderCollection | Improve this Doc View Source Session Declaration public SessionEventArgs Session { get; } Property Value Type Description SessionEventArgs The session arguments." }, "api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html": { "href": "api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html", "title": "Class SessionEventArgs | Titanium Web Proxy", - "keywords": "Class SessionEventArgs 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. Inheritance Object EventArgs SessionEventArgsBase SessionEventArgs Implements IDisposable Inherited Members SessionEventArgsBase.BufferPool SessionEventArgsBase.ExceptionFunc SessionEventArgsBase.TimeLine SessionEventArgsBase.UserData SessionEventArgsBase.IsHttps SessionEventArgsBase.ClientEndPoint SessionEventArgsBase.HttpClient SessionEventArgsBase.WebSession SessionEventArgsBase.CustomUpStreamProxyUsed SessionEventArgsBase.LocalEndPoint SessionEventArgsBase.IsTransparent SessionEventArgsBase.Exception SessionEventArgsBase.DataSent SessionEventArgsBase.DataReceived SessionEventArgsBase.TerminateSession() EventArgs.Empty Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Titanium.Web.Proxy.EventArguments Assembly : Titanium.Web.Proxy.dll Syntax public class SessionEventArgs : SessionEventArgsBase, IDisposable Constructors | Improve this Doc View Source SessionEventArgs(ProxyServer, ProxyEndPoint, Request, CancellationTokenSource) Declaration protected SessionEventArgs(ProxyServer server, ProxyEndPoint endPoint, Request request, CancellationTokenSource cancellationTokenSource) Parameters Type Name Description ProxyServer server ProxyEndPoint endPoint Request request CancellationTokenSource cancellationTokenSource Properties | Improve this Doc View Source IsPromise Is this session a HTTP/2 promise? Declaration public bool IsPromise { get; } Property Value Type Description Boolean | Improve this Doc View Source ReRequest Should we send the request again ? Declaration public bool ReRequest { get; set; } Property Value Type Description Boolean Methods | Improve this Doc View Source Dispose() Implement any cleanup here Declaration public override void Dispose() Overrides SessionEventArgsBase.Dispose() | Improve this Doc View Source GenericResponse(Byte[], HttpStatusCode, Dictionary, Boolean) Before request is made to server respond with the specified byte[], the specified status to client. And then ignore the request. Declaration public void GenericResponse(byte[] result, HttpStatusCode status, Dictionary headers, bool closeServerConnection = false) Parameters Type Name Description Byte [] result The bytes to sent. HttpStatusCode status The HTTP status code. Dictionary < String , HttpHeader > headers The HTTP headers. Boolean closeServerConnection Close the server connection used by request if any? | Improve this Doc View Source GenericResponse(String, HttpStatusCode, Dictionary, Boolean) Before request is made to server respond with the specified HTML string and the specified status to client. And then ignore the request. Declaration public void GenericResponse(string html, HttpStatusCode status, Dictionary headers = null, bool closeServerConnection = false) Parameters Type Name Description String html The html content. HttpStatusCode status The HTTP status code. Dictionary < String , HttpHeader > headers The HTTP headers. Boolean closeServerConnection Close the server connection used by request if any? | Improve this Doc View Source GetRequestBody(CancellationToken) Gets the request body as bytes. Declaration public Task GetRequestBody(CancellationToken cancellationToken = default(CancellationToken)) Parameters Type Name Description CancellationToken cancellationToken Optional cancellation token for this async task. Returns Type Description Task < Byte []> The body as bytes. | Improve this Doc View Source GetRequestBodyAsString(CancellationToken) Gets the request body as string. Declaration public Task GetRequestBodyAsString(CancellationToken cancellationToken = default(CancellationToken)) Parameters Type Name Description CancellationToken cancellationToken Optional cancellation token for this async task. Returns Type Description Task < String > The body as string. | Improve this Doc View Source GetResponseBody(CancellationToken) Gets the response body as bytes. Declaration public Task GetResponseBody(CancellationToken cancellationToken = default(CancellationToken)) Parameters Type Name Description CancellationToken cancellationToken Optional cancellation token for this async task. Returns Type Description Task < Byte []> The resulting bytes. | Improve this Doc View Source GetResponseBodyAsString(CancellationToken) Gets the response body as string. Declaration public Task GetResponseBodyAsString(CancellationToken cancellationToken = default(CancellationToken)) Parameters Type Name Description CancellationToken cancellationToken Optional cancellation token for this async task. Returns Type Description Task < String > The string body. | Improve this Doc View Source Ok(Byte[], Dictionary, Boolean) Before request is made to server respond with the specified byte[] to client and ignore the request. Declaration public void Ok(byte[] result, Dictionary headers = null, bool closeServerConnection = false) Parameters Type Name Description Byte [] result The html content bytes. Dictionary < String , HttpHeader > headers The HTTP headers. Boolean closeServerConnection Close the server connection used by request if any? | Improve this Doc View Source Ok(String, Dictionary, Boolean) Before request is made to server respond with the specified HTML string to client and ignore the request. Declaration public void Ok(string html, Dictionary headers = null, bool closeServerConnection = false) Parameters Type Name Description String html HTML content to sent. Dictionary < String , HttpHeader > headers HTTP response headers. Boolean closeServerConnection Close the server connection used by request if any? | Improve this Doc View Source Redirect(String, Boolean) Redirect to provided URL. Declaration public void Redirect(string url, bool closeServerConnection = false) Parameters Type Name Description String url The URL to redirect. Boolean closeServerConnection Close the server connection used by request if any? | Improve this Doc View Source Respond(Response, Boolean) Respond with given response object to client. Declaration public void Respond(Response response, bool closeServerConnection = false) Parameters Type Name Description Response response The response object. Boolean closeServerConnection Close the server connection used by request if any? | Improve this Doc View Source SetRequestBody(Byte[]) Sets the request body. Declaration public void SetRequestBody(byte[] body) Parameters Type Name Description Byte [] body The request body bytes. | Improve this Doc View Source SetRequestBodyString(String) Sets the body with the specified string. Declaration public void SetRequestBodyString(string body) Parameters Type Name Description String body The request body string to set. | Improve this Doc View Source SetResponseBody(Byte[]) Set the response body bytes. Declaration public void SetResponseBody(byte[] body) Parameters Type Name Description Byte [] body The body bytes to set. | Improve this Doc View Source SetResponseBodyString(String) Replace the response body with the specified string. Declaration public void SetResponseBodyString(string body) Parameters Type Name Description String body The body string to set. | Improve this Doc View Source TerminateServerConnection() Terminate the connection to server at the end of this HTTP request/response session. Declaration public void TerminateServerConnection() Events | Improve this Doc View Source MultipartRequestPartSent Occurs when multipart request part sent. Declaration public event EventHandler MultipartRequestPartSent Event Type Type Description EventHandler < MultipartRequestPartSentEventArgs > Implements System.IDisposable" + "keywords": "Class SessionEventArgs 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. Inheritance Object SessionEventArgsBase SessionEventArgs Implements IDisposable Inherited Members SessionEventArgsBase.ClientConnectionId SessionEventArgsBase.ServerConnectionId SessionEventArgsBase.BufferPool SessionEventArgsBase.ExceptionFunc SessionEventArgsBase.TimeLine SessionEventArgsBase.UserData SessionEventArgsBase.EnableWinAuth SessionEventArgsBase.IsHttps SessionEventArgsBase.ClientLocalEndPoint SessionEventArgsBase.ClientRemoteEndPoint SessionEventArgsBase.ClientEndPoint SessionEventArgsBase.HttpClient SessionEventArgsBase.WebSession SessionEventArgsBase.CustomUpStreamProxy SessionEventArgsBase.CustomUpStreamProxyUsed SessionEventArgsBase.ProxyEndPoint SessionEventArgsBase.LocalEndPoint SessionEventArgsBase.IsTransparent SessionEventArgsBase.Exception SessionEventArgsBase.DataSent SessionEventArgsBase.DataReceived SessionEventArgsBase.TerminateSession() Namespace : Titanium.Web.Proxy.EventArguments Assembly : Titanium.Web.Proxy.dll Syntax public class SessionEventArgs : SessionEventArgsBase, IDisposable Properties | Improve this Doc View Source IsPromise Is this session a HTTP/2 promise? Declaration public bool IsPromise { get; } Property Value Type Description Boolean | Improve this Doc View Source ReRequest Should we send the request again ? Declaration public bool ReRequest { get; set; } Property Value Type Description Boolean | Improve this Doc View Source WebSocketDecoder Declaration public WebSocketDecoder WebSocketDecoder { get; } Property Value Type Description WebSocketDecoder Methods | Improve this Doc View Source Dispose() Implement any cleanup here Declaration public override void Dispose() Overrides SessionEventArgsBase.Dispose() | Improve this Doc View Source GenericResponse(Byte[], HttpStatusCode, Dictionary, Boolean) Before request is made to server respond with the specified byte[], the specified status to client. And then ignore the request. Declaration public void GenericResponse(byte[] result, HttpStatusCode status, Dictionary headers, bool closeServerConnection = false) Parameters Type Name Description Byte [] result The bytes to sent. HttpStatusCode status The HTTP status code. Dictionary < String , HttpHeader > headers The HTTP headers. Boolean closeServerConnection Close the server connection used by request if any? | Improve this Doc View Source GenericResponse(String, HttpStatusCode, Dictionary, Boolean) Before request is made to server respond with the specified HTML string and the specified status to client. And then ignore the request. Declaration public void GenericResponse(string html, HttpStatusCode status, Dictionary headers = null, bool closeServerConnection = false) Parameters Type Name Description String html The html content. HttpStatusCode status The HTTP status code. Dictionary < String , HttpHeader > headers The HTTP headers. Boolean closeServerConnection Close the server connection used by request if any? | Improve this Doc View Source GetRequestBody(CancellationToken) Gets the request body as bytes. Declaration public Task GetRequestBody(CancellationToken cancellationToken = default(CancellationToken)) Parameters Type Name Description CancellationToken cancellationToken Optional cancellation token for this async task. Returns Type Description Task < Byte []> The body as bytes. | Improve this Doc View Source GetRequestBodyAsString(CancellationToken) Gets the request body as string. Declaration public Task GetRequestBodyAsString(CancellationToken cancellationToken = default(CancellationToken)) Parameters Type Name Description CancellationToken cancellationToken Optional cancellation token for this async task. Returns Type Description Task < String > The body as string. | Improve this Doc View Source GetResponseBody(CancellationToken) Gets the response body as bytes. Declaration public Task GetResponseBody(CancellationToken cancellationToken = default(CancellationToken)) Parameters Type Name Description CancellationToken cancellationToken Optional cancellation token for this async task. Returns Type Description Task < Byte []> The resulting bytes. | Improve this Doc View Source GetResponseBodyAsString(CancellationToken) Gets the response body as string. Declaration public Task GetResponseBodyAsString(CancellationToken cancellationToken = default(CancellationToken)) Parameters Type Name Description CancellationToken cancellationToken Optional cancellation token for this async task. Returns Type Description Task < String > The string body. | Improve this Doc View Source Ok(Byte[], Dictionary, Boolean) Before request is made to server respond with the specified byte[] to client and ignore the request. Declaration public void Ok(byte[] result, Dictionary headers = null, bool closeServerConnection = false) Parameters Type Name Description Byte [] result The html content bytes. Dictionary < String , HttpHeader > headers The HTTP headers. Boolean closeServerConnection Close the server connection used by request if any? | Improve this Doc View Source Ok(String, Dictionary, Boolean) Before request is made to server respond with the specified HTML string to client and ignore the request. Declaration public void Ok(string html, Dictionary headers = null, bool closeServerConnection = false) Parameters Type Name Description String html HTML content to sent. Dictionary < String , HttpHeader > headers HTTP response headers. Boolean closeServerConnection Close the server connection used by request if any? | Improve this Doc View Source Redirect(String, Boolean) Redirect to provided URL. Declaration public void Redirect(string url, bool closeServerConnection = false) Parameters Type Name Description String url The URL to redirect. Boolean closeServerConnection Close the server connection used by request if any? | Improve this Doc View Source Respond(Response, Boolean) Respond with given response object to client. Declaration public void Respond(Response response, bool closeServerConnection = false) Parameters Type Name Description Response response The response object. Boolean closeServerConnection Close the server connection used by request if any? | Improve this Doc View Source SetRequestBody(Byte[]) Sets the request body. Declaration public void SetRequestBody(byte[] body) Parameters Type Name Description Byte [] body The request body bytes. | Improve this Doc View Source SetRequestBodyString(String) Sets the body with the specified string. Declaration public void SetRequestBodyString(string body) Parameters Type Name Description String body The request body string to set. | Improve this Doc View Source SetResponseBody(Byte[]) Set the response body bytes. Declaration public void SetResponseBody(byte[] body) Parameters Type Name Description Byte [] body The body bytes to set. | Improve this Doc View Source SetResponseBodyString(String) Replace the response body with the specified string. Declaration public void SetResponseBodyString(string body) Parameters Type Name Description String body The body string to set. | Improve this Doc View Source TerminateServerConnection() Terminate the connection to server at the end of this HTTP request/response session. Declaration public void TerminateServerConnection() Events | Improve this Doc View Source MultipartRequestPartSent Occurs when multipart request part sent. Declaration public event EventHandler MultipartRequestPartSent Event Type Type Description EventHandler < MultipartRequestPartSentEventArgs > Implements System.IDisposable" }, "api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html": { "href": "api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html", "title": "Class SessionEventArgsBase | Titanium Web Proxy", - "keywords": "Class SessionEventArgsBase 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. Inheritance Object EventArgs SessionEventArgsBase SessionEventArgs TunnelConnectSessionEventArgs Implements IDisposable Inherited Members EventArgs.Empty Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Titanium.Web.Proxy.EventArguments Assembly : Titanium.Web.Proxy.dll Syntax public abstract class SessionEventArgsBase : EventArgs, IDisposable Constructors | Improve this Doc View Source SessionEventArgsBase(ProxyServer, ProxyEndPoint, CancellationTokenSource, Request) Declaration protected SessionEventArgsBase(ProxyServer server, ProxyEndPoint endPoint, CancellationTokenSource cancellationTokenSource, Request request) Parameters Type Name Description ProxyServer server ProxyEndPoint endPoint CancellationTokenSource cancellationTokenSource Request request Fields | Improve this Doc View Source BufferPool Declaration protected readonly IBufferPool BufferPool Field Value Type Description IBufferPool | Improve this Doc View Source ExceptionFunc Declaration protected readonly ExceptionHandler ExceptionFunc Field Value Type Description ExceptionHandler Properties | Improve this Doc View Source ClientEndPoint Client End Point. Declaration public IPEndPoint ClientEndPoint { get; } Property Value Type Description IPEndPoint | Improve this Doc View Source CustomUpStreamProxyUsed Are we using a custom upstream HTTP(S) proxy? Declaration public ExternalProxy CustomUpStreamProxyUsed { get; } Property Value Type Description ExternalProxy | Improve this Doc View Source Exception The last exception that happened. Declaration public Exception Exception { get; } Property Value Type Description Exception | Improve this Doc View Source HttpClient The web client used to communicate with server for this session. Declaration public HttpWebClient HttpClient { get; } Property Value Type Description HttpWebClient | Improve this Doc View Source IsHttps Does this session uses SSL? Declaration public bool IsHttps { get; } Property Value Type Description Boolean | Improve this Doc View Source IsTransparent Is this a transparent endpoint? Declaration public bool IsTransparent { get; } Property Value Type Description Boolean | Improve this Doc View Source LocalEndPoint Local endpoint via which we make the request. Declaration public ProxyEndPoint LocalEndPoint { get; } Property Value Type Description ProxyEndPoint | Improve this Doc View Source TimeLine Relative milliseconds for various events. Declaration public Dictionary TimeLine { get; } Property Value Type Description Dictionary < String , DateTime > | Improve this Doc View Source UserData Returns a user data for this request/response session which is same as the user data of HttpClient. Declaration public object UserData { get; set; } Property Value Type Description Object | Improve this Doc View Source WebSession Declaration [Obsolete(\"Use HttpClient instead.\")] public HttpWebClient WebSession { get; } Property Value Type Description HttpWebClient Methods | Improve this Doc View Source Dispose() Implements cleanup here. Declaration public virtual void Dispose() | Improve this Doc View Source TerminateSession() Terminates the session abruptly by terminating client/server connections. Declaration public void TerminateSession() Events | Improve this Doc View Source DataReceived Fired when data is received within this session from client/server. Declaration public event EventHandler DataReceived Event Type Type Description EventHandler < DataEventArgs > | Improve this Doc View Source DataSent Fired when data is sent within this session to server/client. Declaration public event EventHandler DataSent Event Type Type Description EventHandler < DataEventArgs > Implements System.IDisposable" + "keywords": "Class SessionEventArgsBase 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. Inheritance Object SessionEventArgsBase SessionEventArgs TunnelConnectSessionEventArgs Implements IDisposable Namespace : Titanium.Web.Proxy.EventArguments Assembly : Titanium.Web.Proxy.dll Syntax public abstract class SessionEventArgsBase : ProxyEventArgsBase, IDisposable Fields | Improve this Doc View Source BufferPool Declaration protected readonly IBufferPool BufferPool Field Value Type Description IBufferPool | Improve this Doc View Source ExceptionFunc Declaration protected readonly ExceptionHandler ExceptionFunc Field Value Type Description ExceptionHandler Properties | Improve this Doc View Source ClientConnectionId Declaration public Guid ClientConnectionId { get; } Property Value Type Description Guid | Improve this Doc View Source ClientEndPoint Declaration [Obsolete(\"Use ClientRemoteEndPoint instead.\")] public IPEndPoint ClientEndPoint { get; } Property Value Type Description IPEndPoint | Improve this Doc View Source ClientLocalEndPoint Client Local End Point. Declaration public IPEndPoint ClientLocalEndPoint { get; } Property Value Type Description IPEndPoint | Improve this Doc View Source ClientRemoteEndPoint Client Remote End Point. Declaration public IPEndPoint ClientRemoteEndPoint { get; } Property Value Type Description IPEndPoint | Improve this Doc View Source CustomUpStreamProxy Gets or sets the custom up stream proxy. Declaration public IExternalProxy? CustomUpStreamProxy { get; set; } Property Value Type Description Nullable < IExternalProxy > The custom up stream proxy. | Improve this Doc View Source CustomUpStreamProxyUsed Are we using a custom upstream HTTP(S) proxy? Declaration public IExternalProxy? CustomUpStreamProxyUsed { get; } Property Value Type Description Nullable < IExternalProxy > | Improve this Doc View Source EnableWinAuth Enable/disable Windows Authentication (NTLM/Kerberos) for the current session. Declaration public bool EnableWinAuth { get; set; } Property Value Type Description Boolean | Improve this Doc View Source Exception The last exception that happened. Declaration public Exception Exception { get; } Property Value Type Description Exception | Improve this Doc View Source HttpClient The web client used to communicate with server for this session. Declaration public HttpWebClient HttpClient { get; } Property Value Type Description HttpWebClient | Improve this Doc View Source IsHttps Does this session uses SSL? Declaration public bool IsHttps { get; } Property Value Type Description Boolean | Improve this Doc View Source IsTransparent Is this a transparent endpoint? Declaration public bool IsTransparent { get; } Property Value Type Description Boolean | Improve this Doc View Source LocalEndPoint Declaration [Obsolete(\"Use ProxyEndPoint instead.\")] public ProxyEndPoint LocalEndPoint { get; } Property Value Type Description ProxyEndPoint | Improve this Doc View Source ProxyEndPoint Local endpoint via which we make the request. Declaration public ProxyEndPoint ProxyEndPoint { get; } Property Value Type Description ProxyEndPoint | Improve this Doc View Source ServerConnectionId Declaration public Guid ServerConnectionId { get; } Property Value Type Description Guid | Improve this Doc View Source TimeLine Relative milliseconds for various events. Declaration public Dictionary TimeLine { get; } Property Value Type Description Dictionary < String , DateTime > | Improve this Doc View Source UserData Returns a user data for this request/response session which is same as the user data of HttpClient. Declaration public object UserData { get; set; } Property Value Type Description Object | Improve this Doc View Source WebSession Declaration [Obsolete(\"Use HttpClient instead.\")] public HttpWebClient WebSession { get; } Property Value Type Description HttpWebClient Methods | Improve this Doc View Source Dispose() Implements cleanup here. Declaration public virtual void Dispose() | Improve this Doc View Source TerminateSession() Terminates the session abruptly by terminating client/server connections. Declaration public void TerminateSession() Events | Improve this Doc View Source DataReceived Fired when data is received within this session from client/server. Declaration public event EventHandler DataReceived Event Type Type Description EventHandler < DataEventArgs > | Improve this Doc View Source DataSent Fired when data is sent within this session to server/client. Declaration public event EventHandler DataSent Event Type Type Description EventHandler < DataEventArgs > Implements System.IDisposable" }, "api/Titanium.Web.Proxy.EventArguments.TunnelConnectSessionEventArgs.html": { "href": "api/Titanium.Web.Proxy.EventArguments.TunnelConnectSessionEventArgs.html", "title": "Class TunnelConnectSessionEventArgs | Titanium Web Proxy", - "keywords": "Class TunnelConnectSessionEventArgs A class that wraps the state when a tunnel connect event happen for Explicit endpoints. Inheritance Object EventArgs SessionEventArgsBase TunnelConnectSessionEventArgs Implements IDisposable Inherited Members SessionEventArgsBase.BufferPool SessionEventArgsBase.ExceptionFunc SessionEventArgsBase.TimeLine SessionEventArgsBase.UserData SessionEventArgsBase.IsHttps SessionEventArgsBase.ClientEndPoint SessionEventArgsBase.HttpClient SessionEventArgsBase.WebSession SessionEventArgsBase.CustomUpStreamProxyUsed SessionEventArgsBase.LocalEndPoint SessionEventArgsBase.IsTransparent SessionEventArgsBase.Exception SessionEventArgsBase.Dispose() SessionEventArgsBase.DataSent SessionEventArgsBase.DataReceived SessionEventArgsBase.TerminateSession() EventArgs.Empty Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Titanium.Web.Proxy.EventArguments Assembly : Titanium.Web.Proxy.dll Syntax public class TunnelConnectSessionEventArgs : SessionEventArgsBase, IDisposable Properties | Improve this Doc View Source DecryptSsl Should we decrypt the Ssl or relay it to server? Default is true. Declaration public bool DecryptSsl { get; set; } Property Value Type Description Boolean | Improve this Doc View Source DenyConnect When set to true it denies the connect request with a Forbidden status. Declaration public bool DenyConnect { get; set; } Property Value Type Description Boolean | Improve this Doc View Source IsHttpsConnect Is this a connect request to secure HTTP server? Or is it to some other protocol. Declaration public bool IsHttpsConnect { get; } Property Value Type Description Boolean Events | Improve this Doc View Source DecryptedDataReceived Fired when decrypted data is received within this session from client/server. Declaration public event EventHandler DecryptedDataReceived Event Type Type Description EventHandler < DataEventArgs > | Improve this Doc View Source DecryptedDataSent Fired when decrypted data is sent within this session to server/client. Declaration public event EventHandler DecryptedDataSent Event Type Type Description EventHandler < DataEventArgs > Implements System.IDisposable" + "keywords": "Class TunnelConnectSessionEventArgs A class that wraps the state when a tunnel connect event happen for Explicit endpoints. Inheritance Object SessionEventArgsBase TunnelConnectSessionEventArgs Implements IDisposable Inherited Members SessionEventArgsBase.ClientConnectionId SessionEventArgsBase.ServerConnectionId SessionEventArgsBase.BufferPool SessionEventArgsBase.ExceptionFunc SessionEventArgsBase.TimeLine SessionEventArgsBase.UserData SessionEventArgsBase.EnableWinAuth SessionEventArgsBase.IsHttps SessionEventArgsBase.ClientLocalEndPoint SessionEventArgsBase.ClientRemoteEndPoint SessionEventArgsBase.ClientEndPoint SessionEventArgsBase.HttpClient SessionEventArgsBase.WebSession SessionEventArgsBase.CustomUpStreamProxy SessionEventArgsBase.CustomUpStreamProxyUsed SessionEventArgsBase.ProxyEndPoint SessionEventArgsBase.LocalEndPoint SessionEventArgsBase.IsTransparent SessionEventArgsBase.Exception SessionEventArgsBase.Dispose() SessionEventArgsBase.DataSent SessionEventArgsBase.DataReceived SessionEventArgsBase.TerminateSession() Namespace : Titanium.Web.Proxy.EventArguments Assembly : Titanium.Web.Proxy.dll Syntax public class TunnelConnectSessionEventArgs : SessionEventArgsBase, IDisposable Properties | Improve this Doc View Source DecryptSsl Should we decrypt the Ssl or relay it to server? Default is true. Declaration public bool DecryptSsl { get; set; } Property Value Type Description Boolean | Improve this Doc View Source DenyConnect When set to true it denies the connect request with a Forbidden status. Declaration public bool DenyConnect { get; set; } Property Value Type Description Boolean | Improve this Doc View Source IsHttpsConnect Is this a connect request to secure HTTP server? Or is it to some other protocol. Declaration public bool IsHttpsConnect { get; } Property Value Type Description Boolean Events | Improve this Doc View Source DecryptedDataReceived Fired when decrypted data is received within this session from client/server. Declaration public event EventHandler DecryptedDataReceived Event Type Type Description EventHandler < DataEventArgs > | Improve this Doc View Source DecryptedDataSent Fired when decrypted data is sent within this session to server/client. Declaration public event EventHandler DecryptedDataSent Event Type Type Description EventHandler < DataEventArgs > Implements System.IDisposable" }, "api/Titanium.Web.Proxy.ExceptionHandler.html": { "href": "api/Titanium.Web.Proxy.ExceptionHandler.html", @@ -52,7 +52,7 @@ "api/Titanium.Web.Proxy.Exceptions.BodyNotFoundException.html": { "href": "api/Titanium.Web.Proxy.Exceptions.BodyNotFoundException.html", "title": "Class BodyNotFoundException | Titanium Web Proxy", - "keywords": "Class BodyNotFoundException An exception thrown when body is unexpectedly empty. Inheritance Object Exception ProxyException BodyNotFoundException Implements ISerializable Inherited Members Exception.GetBaseException() Exception.GetObjectData(SerializationInfo, StreamingContext) Exception.GetType() Exception.ToString() Exception.Data Exception.HelpLink Exception.HResult Exception.InnerException Exception.Message Exception.Source Exception.StackTrace Exception.TargetSite Exception.SerializeObjectState Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Namespace : Titanium.Web.Proxy.Exceptions Assembly : Titanium.Web.Proxy.dll Syntax public class BodyNotFoundException : ProxyException, ISerializable Implements System.Runtime.Serialization.ISerializable" + "keywords": "Class BodyNotFoundException An exception thrown when body is unexpectedly empty. Inheritance Object Exception ProxyException BodyNotFoundException 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 BodyNotFoundException : ProxyException, ISerializable, _Exception Implements System.Runtime.Serialization.ISerializable System.Runtime.InteropServices._Exception" }, "api/Titanium.Web.Proxy.Exceptions.html": { "href": "api/Titanium.Web.Proxy.Exceptions.html", @@ -62,27 +62,27 @@ "api/Titanium.Web.Proxy.Exceptions.ProxyAuthorizationException.html": { "href": "api/Titanium.Web.Proxy.Exceptions.ProxyAuthorizationException.html", "title": "Class ProxyAuthorizationException | Titanium Web Proxy", - "keywords": "Class ProxyAuthorizationException Proxy authorization exception. Inheritance Object Exception ProxyException ProxyAuthorizationException Implements ISerializable Inherited Members Exception.GetBaseException() Exception.GetObjectData(SerializationInfo, StreamingContext) Exception.GetType() Exception.ToString() Exception.Data Exception.HelpLink Exception.HResult Exception.InnerException Exception.Message Exception.Source Exception.StackTrace Exception.TargetSite Exception.SerializeObjectState Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Namespace : Titanium.Web.Proxy.Exceptions Assembly : Titanium.Web.Proxy.dll Syntax public class ProxyAuthorizationException : ProxyException, ISerializable Properties | Improve this Doc View Source Headers Headers associated with the authorization exception. Declaration public IEnumerable Headers { get; } Property Value Type Description IEnumerable < HttpHeader > | Improve this Doc View Source Session The current session within which this error happened. Declaration public SessionEventArgsBase Session { get; } Property Value Type Description SessionEventArgsBase Implements System.Runtime.Serialization.ISerializable" + "keywords": "Class ProxyAuthorizationException Proxy authorization exception. Inheritance Object Exception ProxyException ProxyAuthorizationException 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 ProxyAuthorizationException : ProxyException, ISerializable, _Exception Properties | Improve this Doc View Source Headers Headers associated with the authorization exception. Declaration public IEnumerable Headers { get; } Property Value Type Description IEnumerable < HttpHeader > | Improve this Doc View Source Session The current session within which this error happened. Declaration public SessionEventArgsBase Session { get; } Property Value Type Description SessionEventArgsBase Implements System.Runtime.Serialization.ISerializable System.Runtime.InteropServices._Exception" }, "api/Titanium.Web.Proxy.Exceptions.ProxyConnectException.html": { "href": "api/Titanium.Web.Proxy.Exceptions.ProxyConnectException.html", "title": "Class ProxyConnectException | Titanium Web Proxy", - "keywords": "Class ProxyConnectException Proxy Connection exception. Inheritance Object Exception ProxyException ProxyConnectException Implements ISerializable Inherited Members Exception.GetBaseException() Exception.GetObjectData(SerializationInfo, StreamingContext) Exception.GetType() Exception.ToString() Exception.Data Exception.HelpLink Exception.HResult Exception.InnerException Exception.Message Exception.Source Exception.StackTrace Exception.TargetSite Exception.SerializeObjectState Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Namespace : Titanium.Web.Proxy.Exceptions Assembly : Titanium.Web.Proxy.dll Syntax public class ProxyConnectException : ProxyException, ISerializable Properties | Improve this Doc View Source Session Gets session info associated to the exception. Declaration public SessionEventArgsBase Session { get; } Property Value Type Description SessionEventArgsBase Remarks This object properties should not be edited. Implements System.Runtime.Serialization.ISerializable" + "keywords": "Class ProxyConnectException Proxy Connection exception. Inheritance Object Exception ProxyException ProxyConnectException 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 ProxyConnectException : ProxyException, ISerializable, _Exception Properties | Improve this Doc View Source Session Gets session info associated to the exception. Declaration public SessionEventArgsBase Session { get; } Property Value Type Description SessionEventArgsBase Remarks This object properties should not be edited. Implements System.Runtime.Serialization.ISerializable System.Runtime.InteropServices._Exception" }, "api/Titanium.Web.Proxy.Exceptions.ProxyException.html": { "href": "api/Titanium.Web.Proxy.Exceptions.ProxyException.html", "title": "Class ProxyException | Titanium Web Proxy", - "keywords": "Class ProxyException Base class exception associated with this proxy server. Inheritance Object Exception ProxyException BodyNotFoundException ProxyAuthorizationException ProxyConnectException ProxyHttpException ServerConnectionException Implements ISerializable Inherited Members Exception.GetBaseException() Exception.GetObjectData(SerializationInfo, StreamingContext) Exception.GetType() Exception.ToString() Exception.Data Exception.HelpLink Exception.HResult Exception.InnerException Exception.Message Exception.Source Exception.StackTrace Exception.TargetSite Exception.SerializeObjectState Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Namespace : Titanium.Web.Proxy.Exceptions Assembly : Titanium.Web.Proxy.dll Syntax public abstract class ProxyException : Exception, ISerializable Constructors | Improve this Doc View Source ProxyException(String) Initializes a new instance of the ProxyException class. must be invoked by derived classes' constructors Declaration protected ProxyException(string message) Parameters Type Name Description String message Exception message | Improve this Doc View Source ProxyException(String, Exception) Initializes a new instance of the ProxyException class. must be invoked by derived classes' constructors Declaration protected ProxyException(string message, Exception innerException) Parameters Type Name Description String message Exception message Exception innerException Inner exception associated Implements System.Runtime.Serialization.ISerializable" + "keywords": "Class ProxyException Base class exception associated with this proxy server. Inheritance Object Exception ProxyException BodyNotFoundException ProxyAuthorizationException ProxyConnectException ProxyHttpException ServerConnectionException 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 abstract class ProxyException : Exception, ISerializable, _Exception Constructors | Improve this Doc View Source ProxyException(String) Initializes a new instance of the ProxyException class. must be invoked by derived classes' constructors Declaration protected ProxyException(string message) Parameters Type Name Description String message Exception message | Improve this Doc View Source ProxyException(String, Exception) Initializes a new instance of the ProxyException class. must be invoked by derived classes' constructors Declaration protected ProxyException(string message, Exception innerException) Parameters Type Name Description String message Exception message Exception innerException Inner exception associated Implements System.Runtime.Serialization.ISerializable System.Runtime.InteropServices._Exception" }, "api/Titanium.Web.Proxy.Exceptions.ProxyHttpException.html": { "href": "api/Titanium.Web.Proxy.Exceptions.ProxyHttpException.html", "title": "Class ProxyHttpException | Titanium Web Proxy", - "keywords": "Class ProxyHttpException Proxy HTTP exception. Inheritance Object Exception ProxyException ProxyHttpException Implements ISerializable Inherited Members Exception.GetBaseException() Exception.GetObjectData(SerializationInfo, StreamingContext) Exception.GetType() Exception.ToString() Exception.Data Exception.HelpLink Exception.HResult Exception.InnerException Exception.Message Exception.Source Exception.StackTrace Exception.TargetSite Exception.SerializeObjectState Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Namespace : Titanium.Web.Proxy.Exceptions Assembly : Titanium.Web.Proxy.dll Syntax public class ProxyHttpException : ProxyException, ISerializable Properties | Improve this Doc View Source Session Gets session info associated to the exception. Declaration public SessionEventArgs Session { get; } Property Value Type Description SessionEventArgs Remarks This object properties should not be edited. Implements System.Runtime.Serialization.ISerializable" + "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 | Improve this Doc View Source Session Gets session info associated to the exception. Declaration public SessionEventArgs Session { 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.Exceptions.ServerConnectionException.html": { "href": "api/Titanium.Web.Proxy.Exceptions.ServerConnectionException.html", "title": "Class ServerConnectionException | Titanium Web Proxy", - "keywords": "Class ServerConnectionException The server connection was closed upon first read with the new connection from pool. Should retry the request with a new connection. Inheritance Object Exception ProxyException ServerConnectionException Implements ISerializable Inherited Members Exception.GetBaseException() Exception.GetObjectData(SerializationInfo, StreamingContext) Exception.GetType() Exception.ToString() Exception.Data Exception.HelpLink Exception.HResult Exception.InnerException Exception.Message Exception.Source Exception.StackTrace Exception.TargetSite Exception.SerializeObjectState Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Namespace : Titanium.Web.Proxy.Exceptions Assembly : Titanium.Web.Proxy.dll Syntax public class ServerConnectionException : ProxyException, ISerializable Implements System.Runtime.Serialization.ISerializable" + "keywords": "Class ServerConnectionException The server connection was closed upon first read with the new connection from pool. Should retry the request with a new connection. Inheritance Object Exception ProxyException ServerConnectionException 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 ServerConnectionException : ProxyException, ISerializable, _Exception Implements System.Runtime.Serialization.ISerializable System.Runtime.InteropServices._Exception" }, "api/Titanium.Web.Proxy.Helpers.html": { "href": "api/Titanium.Web.Proxy.Helpers.html", @@ -92,7 +92,7 @@ "api/Titanium.Web.Proxy.Helpers.RunTime.html": { "href": "api/Titanium.Web.Proxy.Helpers.RunTime.html", "title": "Class RunTime | Titanium Web Proxy", - "keywords": "Class RunTime Run time helpers Inheritance Object RunTime Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Titanium.Web.Proxy.Helpers Assembly : Titanium.Web.Proxy.dll Syntax public static class RunTime Properties | Improve this Doc View Source IsLinux Declaration public static bool IsLinux { get; } Property Value Type Description Boolean | Improve this Doc View Source IsMac Declaration public static bool IsMac { get; } Property Value Type Description Boolean | Improve this Doc View Source IsUwpOnWindows Declaration public static bool IsUwpOnWindows { get; } Property Value Type Description Boolean | Improve this Doc View Source IsWindows Declaration public static bool IsWindows { get; } Property Value Type Description Boolean" + "keywords": "Class RunTime Run time helpers Inheritance Object RunTime Inherited Members Object.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Helpers Assembly : Titanium.Web.Proxy.dll Syntax public static class RunTime Properties | Improve this Doc View Source IsLinux Declaration public static bool IsLinux { get; } Property Value Type Description Boolean | Improve this Doc View Source IsMac Declaration public static bool IsMac { get; } Property Value Type Description Boolean | Improve this Doc View Source IsSocketReuseAvailable Is socket reuse available to use? Declaration public static bool IsSocketReuseAvailable { get; } Property Value Type Description Boolean | Improve this Doc View Source IsUwpOnWindows Declaration public static bool IsUwpOnWindows { get; } Property Value Type Description Boolean | Improve this Doc View Source IsWindows Declaration public static bool IsWindows { get; } Property Value Type Description Boolean" }, "api/Titanium.Web.Proxy.html": { "href": "api/Titanium.Web.Proxy.html", @@ -102,17 +102,17 @@ "api/Titanium.Web.Proxy.Http.ConnectRequest.html": { "href": "api/Titanium.Web.Proxy.Http.ConnectRequest.html", "title": "Class ConnectRequest | Titanium Web Proxy", - "keywords": "Class ConnectRequest The tcp tunnel Connect request. Inheritance Object RequestResponseBase Request ConnectRequest Inherited Members Request.Method Request.RequestUri Request.IsHttps Request.OriginalUrl Request.RequestUriString Request.HasBody Request.Host Request.ExpectContinue Request.IsMultipartFormData Request.Url Request.UpgradeToWebSocket Request.ExpectationSucceeded Request.ExpectationFailed Request.HeaderText RequestResponseBase.BodyInternal RequestResponseBase.KeepBody RequestResponseBase.HttpVersion RequestResponseBase.Headers RequestResponseBase.ContentLength RequestResponseBase.ContentEncoding RequestResponseBase.Encoding RequestResponseBase.ContentType RequestResponseBase.IsChunked RequestResponseBase.Body RequestResponseBase.BodyString RequestResponseBase.IsBodyRead RequestResponseBase.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Namespace : Titanium.Web.Proxy.Http Assembly : Titanium.Web.Proxy.dll Syntax public class ConnectRequest : Request Constructors | Improve this Doc View Source ConnectRequest() Declaration public ConnectRequest() Properties | Improve this Doc View Source ClientHelloInfo Declaration public ClientHelloInfo ClientHelloInfo { get; set; } Property Value Type Description ClientHelloInfo | Improve this Doc View Source TunnelType Declaration public TunnelType TunnelType { get; } Property Value Type Description TunnelType" + "keywords": "Class ConnectRequest The tcp tunnel Connect request. Inheritance Object RequestResponseBase Request ConnectRequest Inherited Members Request.Method Request.IsHttps Request.RequestUri Request.Url Request.RequestUriString Request.HasBody Request.Host Request.ExpectContinue Request.IsMultipartFormData Request.UpgradeToWebSocket Request.ExpectationSucceeded Request.ExpectationFailed Request.HeaderText RequestResponseBase.BodyInternal RequestResponseBase.KeepBody RequestResponseBase.HttpVersion RequestResponseBase.Headers RequestResponseBase.ContentLength RequestResponseBase.ContentEncoding RequestResponseBase.Encoding RequestResponseBase.ContentType RequestResponseBase.IsChunked RequestResponseBase.Body RequestResponseBase.BodyString RequestResponseBase.IsBodyRead RequestResponseBase.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Http Assembly : Titanium.Web.Proxy.dll Syntax public class ConnectRequest : Request Properties | Improve this Doc View Source ClientHelloInfo Declaration public ClientHelloInfo? ClientHelloInfo { get; set; } Property Value Type Description Nullable < ClientHelloInfo > | Improve this Doc View Source TunnelType Declaration public TunnelType TunnelType { get; } Property Value Type Description TunnelType" }, "api/Titanium.Web.Proxy.Http.ConnectResponse.html": { "href": "api/Titanium.Web.Proxy.Http.ConnectResponse.html", "title": "Class ConnectResponse | Titanium Web Proxy", - "keywords": "Class ConnectResponse The tcp tunnel connect response object. Inheritance Object RequestResponseBase Response ConnectResponse Inherited Members Response.StatusCode Response.StatusDescription Response.HasBody Response.KeepAlive Response.HeaderText RequestResponseBase.BodyInternal RequestResponseBase.KeepBody RequestResponseBase.HttpVersion RequestResponseBase.Headers RequestResponseBase.ContentLength RequestResponseBase.ContentEncoding RequestResponseBase.Encoding RequestResponseBase.ContentType RequestResponseBase.IsChunked RequestResponseBase.Body RequestResponseBase.BodyString RequestResponseBase.IsBodyRead RequestResponseBase.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Namespace : Titanium.Web.Proxy.Http Assembly : Titanium.Web.Proxy.dll Syntax public class ConnectResponse : Response Properties | Improve this Doc View Source ServerHelloInfo Declaration public ServerHelloInfo ServerHelloInfo { get; set; } Property Value Type Description ServerHelloInfo" + "keywords": "Class ConnectResponse The tcp tunnel connect response object. Inheritance Object RequestResponseBase Response ConnectResponse Inherited Members Response.StatusCode Response.StatusDescription Response.HasBody Response.KeepAlive Response.HeaderText RequestResponseBase.BodyInternal RequestResponseBase.KeepBody RequestResponseBase.HttpVersion RequestResponseBase.Headers RequestResponseBase.ContentLength RequestResponseBase.ContentEncoding RequestResponseBase.Encoding RequestResponseBase.ContentType RequestResponseBase.IsChunked RequestResponseBase.Body RequestResponseBase.BodyString RequestResponseBase.IsBodyRead RequestResponseBase.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Http Assembly : Titanium.Web.Proxy.dll Syntax public class ConnectResponse : Response Properties | Improve this Doc View Source ServerHelloInfo Declaration public ServerHelloInfo? ServerHelloInfo { get; set; } Property Value Type Description Nullable < ServerHelloInfo >" }, "api/Titanium.Web.Proxy.Http.HeaderCollection.html": { "href": "api/Titanium.Web.Proxy.Http.HeaderCollection.html", "title": "Class HeaderCollection | Titanium Web Proxy", - "keywords": "Class HeaderCollection The http header collection. Inheritance Object HeaderCollection Implements IEnumerable < HttpHeader > IEnumerable Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Titanium.Web.Proxy.Http Assembly : Titanium.Web.Proxy.dll Syntax [TypeConverter(typeof(ExpandableObjectConverter))] public class HeaderCollection : IEnumerable, IEnumerable Constructors | Improve this Doc View Source HeaderCollection() Initializes a new instance of the HeaderCollection class. Declaration public HeaderCollection() Properties | Improve this Doc View Source Headers Unique Request header collection. Declaration public ReadOnlyDictionary Headers { get; } Property Value Type Description ReadOnlyDictionary < String , HttpHeader > | Improve this Doc View Source NonUniqueHeaders Non Unique headers. Declaration public ReadOnlyDictionary> NonUniqueHeaders { get; } Property Value Type Description ReadOnlyDictionary < String , List < HttpHeader >> Methods | Improve this Doc View Source AddHeader(String, String) Add a new header with given name and value Declaration public void AddHeader(string name, string value) Parameters Type Name Description String name String value | Improve this Doc View Source AddHeader(HttpHeader) Adds the given header object to Request Declaration public void AddHeader(HttpHeader newHeader) Parameters Type Name Description HttpHeader newHeader | Improve this Doc View Source AddHeaders(IEnumerable>) Adds the given header objects to Request Declaration public void AddHeaders(IEnumerable> newHeaders) Parameters Type Name Description IEnumerable < KeyValuePair < String , String >> newHeaders | Improve this Doc View Source AddHeaders(IEnumerable>) Adds the given header objects to Request Declaration public void AddHeaders(IEnumerable> newHeaders) Parameters Type Name Description IEnumerable < KeyValuePair < String , HttpHeader >> newHeaders | Improve this Doc View Source AddHeaders(IEnumerable) Adds the given header objects to Request Declaration public void AddHeaders(IEnumerable newHeaders) Parameters Type Name Description IEnumerable < HttpHeader > newHeaders | Improve this Doc View Source Clear() Removes all the headers. Declaration public void Clear() | Improve this Doc View Source GetAllHeaders() Returns all headers Declaration public List GetAllHeaders() Returns Type Description List < HttpHeader > | Improve this Doc View Source GetEnumerator() Returns an enumerator that iterates through the collection. Declaration public IEnumerator GetEnumerator() Returns Type Description IEnumerator < HttpHeader > An enumerator that can be used to iterate through the collection. | Improve this Doc View Source GetFirstHeader(String) Declaration public HttpHeader GetFirstHeader(string name) Parameters Type Name Description String name Returns Type Description HttpHeader | Improve this Doc View Source GetHeaders(String) Returns all headers with given name if exists Returns null if doesn't exist Declaration public List GetHeaders(string name) Parameters Type Name Description String name Returns Type Description List < HttpHeader > | Improve this Doc View Source HeaderExists(String) True if header exists Declaration public bool HeaderExists(string name) Parameters Type Name Description String name Returns Type Description Boolean | Improve this Doc View Source RemoveHeader(String) removes all headers with given name Declaration public bool RemoveHeader(string headerName) Parameters Type Name Description String headerName Returns Type Description Boolean True if header was removed False if no header exists with given name | Improve this Doc View Source RemoveHeader(HttpHeader) Removes given header object if it exist Declaration public bool RemoveHeader(HttpHeader header) Parameters Type Name Description HttpHeader header Returns true if header exists and was removed Returns Type Description Boolean Explicit Interface Implementations | Improve this Doc View Source IEnumerable.GetEnumerator() Declaration IEnumerator IEnumerable.GetEnumerator() Returns Type Description IEnumerator Implements System.Collections.Generic.IEnumerable System.Collections.IEnumerable" + "keywords": "Class HeaderCollection The http header collection. Inheritance Object HeaderCollection Implements IEnumerable < HttpHeader > IEnumerable Inherited Members Object.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Http Assembly : Titanium.Web.Proxy.dll Syntax [TypeConverter(typeof(ExpandableObjectConverter))] public class HeaderCollection : IEnumerable, IEnumerable Constructors | Improve this Doc View Source HeaderCollection() Initializes a new instance of the HeaderCollection class. Declaration public HeaderCollection() Properties | Improve this Doc View Source Headers Unique Request header collection. Declaration public ReadOnlyDictionary Headers { get; } Property Value Type Description ReadOnlyDictionary < String , HttpHeader > | Improve this Doc View Source NonUniqueHeaders Non Unique headers. Declaration public ReadOnlyDictionary> NonUniqueHeaders { get; } Property Value Type Description ReadOnlyDictionary < String , List < HttpHeader >> Methods | Improve this Doc View Source AddHeader(String, String) Add a new header with given name and value Declaration public void AddHeader(string name, string value) Parameters Type Name Description String name String value | Improve this Doc View Source AddHeader(HttpHeader) Adds the given header object to Request Declaration public void AddHeader(HttpHeader newHeader) Parameters Type Name Description HttpHeader newHeader | Improve this Doc View Source AddHeaders(IEnumerable>) Adds the given header objects to Request Declaration public void AddHeaders(IEnumerable> newHeaders) Parameters Type Name Description IEnumerable < KeyValuePair < String , String >> newHeaders | Improve this Doc View Source AddHeaders(IEnumerable>) Adds the given header objects to Request Declaration public void AddHeaders(IEnumerable> newHeaders) Parameters Type Name Description IEnumerable < KeyValuePair < String , HttpHeader >> newHeaders | Improve this Doc View Source AddHeaders(IEnumerable) Adds the given header objects to Request Declaration public void AddHeaders(IEnumerable newHeaders) Parameters Type Name Description IEnumerable < HttpHeader > newHeaders | Improve this Doc View Source Clear() Removes all the headers. Declaration public void Clear() | Improve this Doc View Source GetAllHeaders() Returns all headers Declaration public List GetAllHeaders() Returns Type Description List < HttpHeader > | Improve this Doc View Source GetEnumerator() Returns an enumerator that iterates through the collection. Declaration public IEnumerator GetEnumerator() Returns Type Description IEnumerator < HttpHeader > An enumerator that can be used to iterate through the collection. | Improve this Doc View Source GetFirstHeader(String) Declaration public HttpHeader GetFirstHeader(string name) Parameters Type Name Description String name Returns Type Description HttpHeader | Improve this Doc View Source GetHeaders(String) Returns all headers with given name if exists Returns null if doesn't exist Declaration public List GetHeaders(string name) Parameters Type Name Description String name Returns Type Description List < HttpHeader > | Improve this Doc View Source HeaderExists(String) True if header exists Declaration public bool HeaderExists(string name) Parameters Type Name Description String name Returns Type Description Boolean | Improve this Doc View Source RemoveHeader(KnownHeader) removes all headers with given name Declaration public bool RemoveHeader(KnownHeader headerName) Parameters Type Name Description KnownHeader headerName Returns Type Description Boolean True if header was removed False if no header exists with given name | Improve this Doc View Source RemoveHeader(String) removes all headers with given name Declaration public bool RemoveHeader(string headerName) Parameters Type Name Description String headerName Returns Type Description Boolean True if header was removed False if no header exists with given name | Improve this Doc View Source RemoveHeader(HttpHeader) Removes given header object if it exist Declaration public bool RemoveHeader(HttpHeader header) Parameters Type Name Description HttpHeader header Returns true if header exists and was removed Returns Type Description Boolean Explicit Interface Implementations | Improve this Doc View Source IEnumerable.GetEnumerator() Declaration IEnumerator IEnumerable.GetEnumerator() Returns Type Description IEnumerator Implements System.Collections.Generic.IEnumerable System.Collections.IEnumerable" }, "api/Titanium.Web.Proxy.Http.html": { "href": "api/Titanium.Web.Proxy.Http.html", @@ -122,32 +122,32 @@ "api/Titanium.Web.Proxy.Http.HttpWebClient.html": { "href": "api/Titanium.Web.Proxy.Http.HttpWebClient.html", "title": "Class HttpWebClient | Titanium Web Proxy", - "keywords": "Class HttpWebClient Used to communicate with the server over HTTP(S) Inheritance Object HttpWebClient Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Titanium.Web.Proxy.Http Assembly : Titanium.Web.Proxy.dll Syntax public class HttpWebClient Properties | Improve this Doc View Source ConnectRequest Headers passed with Connect. Declaration public ConnectRequest ConnectRequest { get; } Property Value Type Description ConnectRequest | Improve this Doc View Source IsHttps Is Https? Declaration public bool IsHttps { get; } Property Value Type Description Boolean | Improve this Doc View Source ProcessId PID of the process that is created the current session when client is running in this machine If client is remote then this will return Declaration public Lazy ProcessId { get; } Property Value Type Description Lazy < Int32 > | Improve this Doc View Source Request Web Request. Declaration public Request Request { get; } Property Value Type Description Request | Improve this Doc View Source Response Web Response. Declaration public Response Response { get; } Property Value Type Description Response | Improve this Doc View Source UpStreamEndPoint Override UpStreamEndPoint for this request; Local NIC via request is made Declaration public IPEndPoint UpStreamEndPoint { get; set; } Property Value Type Description IPEndPoint | Improve this Doc View Source UserData Gets or sets the user data. Declaration public object UserData { get; set; } Property Value Type Description Object" + "keywords": "Class HttpWebClient Used to communicate with the server over HTTP(S) Inheritance Object HttpWebClient Inherited Members Object.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Http Assembly : Titanium.Web.Proxy.dll Syntax public class HttpWebClient Properties | Improve this Doc View Source ConnectRequest Headers passed with Connect. Declaration public ConnectRequest ConnectRequest { get; } Property Value Type Description ConnectRequest | Improve this Doc View Source IsHttps Is Https? Declaration public bool IsHttps { get; } Property Value Type Description Boolean | Improve this Doc View Source ProcessId PID of the process that is created the current session when client is running in this machine If client is remote then this will return Declaration public Lazy ProcessId { get; } Property Value Type Description Lazy < Int32 > | Improve this Doc View Source Request Web Request. Declaration public Request Request { get; } Property Value Type Description Request | Improve this Doc View Source Response Web Response. Declaration public Response Response { get; } Property Value Type Description Response | Improve this Doc View Source UpStreamEndPoint Override UpStreamEndPoint for this request; Local NIC via request is made Declaration public IPEndPoint UpStreamEndPoint { get; set; } Property Value Type Description IPEndPoint | Improve this Doc View Source UserData Gets or sets the user data. Declaration public object UserData { get; set; } Property Value Type Description Object" }, "api/Titanium.Web.Proxy.Http.KnownHeaders.html": { "href": "api/Titanium.Web.Proxy.Http.KnownHeaders.html", "title": "Class KnownHeaders | Titanium Web Proxy", - "keywords": "Class KnownHeaders Well known http headers. Inheritance Object KnownHeaders Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Titanium.Web.Proxy.Http Assembly : Titanium.Web.Proxy.dll Syntax public static class KnownHeaders Fields | Improve this Doc View Source AcceptEncoding Declaration public const string AcceptEncoding = \"Accept-Encoding\" Field Value Type Description String | Improve this Doc View Source Authorization Declaration public const string Authorization = \"Authorization\" Field Value Type Description String | Improve this Doc View Source Connection Declaration public const string Connection = \"Connection\" Field Value Type Description String | Improve this Doc View Source ConnectionClose Declaration public const string ConnectionClose = \"close\" Field Value Type Description String | Improve this Doc View Source ConnectionKeepAlive Declaration public const string ConnectionKeepAlive = \"keep-alive\" Field Value Type Description String | Improve this Doc View Source ContentEncoding Declaration public const string ContentEncoding = \"Content-Encoding\" Field Value Type Description String | Improve this Doc View Source ContentEncodingBrotli Declaration public const string ContentEncodingBrotli = \"br\" Field Value Type Description String | Improve this Doc View Source ContentEncodingDeflate Declaration public const string ContentEncodingDeflate = \"deflate\" Field Value Type Description String | Improve this Doc View Source ContentEncodingGzip Declaration public const string ContentEncodingGzip = \"gzip\" Field Value Type Description String | Improve this Doc View Source ContentLength Declaration public const string ContentLength = \"Content-Length\" Field Value Type Description String | Improve this Doc View Source ContentType Declaration public const string ContentType = \"Content-Type\" Field Value Type Description String | Improve this Doc View Source ContentTypeBoundary Declaration public const string ContentTypeBoundary = \"boundary\" Field Value Type Description String | Improve this Doc View Source ContentTypeCharset Declaration public const string ContentTypeCharset = \"charset\" Field Value Type Description String | Improve this Doc View Source Expect Declaration public const string Expect = \"Expect\" Field Value Type Description String | Improve this Doc View Source Expect100Continue Declaration public const string Expect100Continue = \"100-continue\" Field Value Type Description String | Improve this Doc View Source Host Declaration public const string Host = \"Host\" Field Value Type Description String | Improve this Doc View Source Location Declaration public const string Location = \"Location\" Field Value Type Description String | Improve this Doc View Source ProxyAuthenticate Declaration public const string ProxyAuthenticate = \"Proxy-Authenticate\" Field Value Type Description String | Improve this Doc View Source ProxyAuthorization Declaration public const string ProxyAuthorization = \"Proxy-Authorization\" Field Value Type Description String | Improve this Doc View Source ProxyAuthorizationBasic Declaration public const string ProxyAuthorizationBasic = \"basic\" Field Value Type Description String | Improve this Doc View Source ProxyConnection Declaration public const string ProxyConnection = \"Proxy-Connection\" Field Value Type Description String | Improve this Doc View Source ProxyConnectionClose Declaration public const string ProxyConnectionClose = \"close\" Field Value Type Description String | Improve this Doc View Source TransferEncoding Declaration public const string TransferEncoding = \"Transfer-Encoding\" Field Value Type Description String | Improve this Doc View Source TransferEncodingChunked Declaration public const string TransferEncodingChunked = \"chunked\" Field Value Type Description String | Improve this Doc View Source Upgrade Declaration public const string Upgrade = \"Upgrade\" Field Value Type Description String | Improve this Doc View Source UpgradeWebsocket Declaration public const string UpgradeWebsocket = \"websocket\" Field Value Type Description String" + "keywords": "Class KnownHeaders Well known http headers. Inheritance Object KnownHeaders Inherited Members Object.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Http Assembly : Titanium.Web.Proxy.dll Syntax public static class KnownHeaders Fields | Improve this Doc View Source AcceptEncoding Declaration public static KnownHeader AcceptEncoding Field Value Type Description KnownHeader | Improve this Doc View Source Authorization Declaration public static KnownHeader Authorization Field Value Type Description KnownHeader | Improve this Doc View Source Connection Declaration public static KnownHeader Connection Field Value Type Description KnownHeader | Improve this Doc View Source ConnectionClose Declaration public static KnownHeader ConnectionClose Field Value Type Description KnownHeader | Improve this Doc View Source ConnectionKeepAlive Declaration public static KnownHeader ConnectionKeepAlive Field Value Type Description KnownHeader | Improve this Doc View Source ContentEncoding Declaration public static KnownHeader ContentEncoding Field Value Type Description KnownHeader | Improve this Doc View Source ContentEncodingBrotli Declaration public static KnownHeader ContentEncodingBrotli Field Value Type Description KnownHeader | Improve this Doc View Source ContentEncodingDeflate Declaration public static KnownHeader ContentEncodingDeflate Field Value Type Description KnownHeader | Improve this Doc View Source ContentEncodingGzip Declaration public static KnownHeader ContentEncodingGzip Field Value Type Description KnownHeader | Improve this Doc View Source ContentLength Declaration public static KnownHeader ContentLength Field Value Type Description KnownHeader | Improve this Doc View Source ContentType Declaration public static KnownHeader ContentType Field Value Type Description KnownHeader | Improve this Doc View Source ContentTypeBoundary Declaration public static KnownHeader ContentTypeBoundary Field Value Type Description KnownHeader | Improve this Doc View Source ContentTypeCharset Declaration public static KnownHeader ContentTypeCharset Field Value Type Description KnownHeader | Improve this Doc View Source Expect Declaration public static KnownHeader Expect Field Value Type Description KnownHeader | Improve this Doc View Source Expect100Continue Declaration public static KnownHeader Expect100Continue Field Value Type Description KnownHeader | Improve this Doc View Source Host Declaration public static KnownHeader Host Field Value Type Description KnownHeader | Improve this Doc View Source Location Declaration public static KnownHeader Location Field Value Type Description KnownHeader | Improve this Doc View Source ProxyAuthenticate Declaration public static KnownHeader ProxyAuthenticate Field Value Type Description KnownHeader | Improve this Doc View Source ProxyAuthorization Declaration public static KnownHeader ProxyAuthorization Field Value Type Description KnownHeader | Improve this Doc View Source ProxyAuthorizationBasic Declaration public static KnownHeader ProxyAuthorizationBasic Field Value Type Description KnownHeader | Improve this Doc View Source ProxyConnection Declaration public static KnownHeader ProxyConnection Field Value Type Description KnownHeader | Improve this Doc View Source ProxyConnectionClose Declaration public static KnownHeader ProxyConnectionClose Field Value Type Description KnownHeader | Improve this Doc View Source TransferEncoding Declaration public static KnownHeader TransferEncoding Field Value Type Description KnownHeader | Improve this Doc View Source TransferEncodingChunked Declaration public static KnownHeader TransferEncodingChunked Field Value Type Description KnownHeader | Improve this Doc View Source Upgrade Declaration public static KnownHeader Upgrade Field Value Type Description KnownHeader | Improve this Doc View Source UpgradeWebsocket Declaration public static KnownHeader UpgradeWebsocket Field Value Type Description KnownHeader" }, "api/Titanium.Web.Proxy.Http.Request.html": { "href": "api/Titanium.Web.Proxy.Http.Request.html", "title": "Class Request | Titanium Web Proxy", - "keywords": "Class Request Http(s) request object Inheritance Object RequestResponseBase Request ConnectRequest Inherited Members RequestResponseBase.BodyInternal RequestResponseBase.KeepBody RequestResponseBase.HttpVersion RequestResponseBase.Headers RequestResponseBase.ContentLength RequestResponseBase.ContentEncoding RequestResponseBase.Encoding RequestResponseBase.ContentType RequestResponseBase.IsChunked RequestResponseBase.Body RequestResponseBase.BodyString RequestResponseBase.IsBodyRead RequestResponseBase.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Namespace : Titanium.Web.Proxy.Http Assembly : Titanium.Web.Proxy.dll Syntax [TypeConverter(typeof(ExpandableObjectConverter))] public class Request : RequestResponseBase Properties | Improve this Doc View Source ExpectationFailed Did server respond negatively for 100 continue request? Declaration public bool ExpectationFailed { get; } Property Value Type Description Boolean | Improve this Doc View Source ExpectationSucceeded Did server respond positively for 100 continue request? Declaration public bool ExpectationSucceeded { get; } Property Value Type Description Boolean | Improve this Doc View Source ExpectContinue Does this request has a 100-continue header? Declaration public bool ExpectContinue { get; } Property Value Type Description Boolean | Improve this Doc View Source HasBody Has request body? Declaration public override bool HasBody { get; } Property Value Type Description Boolean Overrides RequestResponseBase.HasBody | Improve this Doc View Source HeaderText Gets the header text. Declaration public override string HeaderText { get; } Property Value Type Description String Overrides RequestResponseBase.HeaderText | Improve this Doc View Source Host Http hostname header value if exists. Note: Changing this does NOT change host in RequestUri. Users can set new RequestUri separately. Declaration public string Host { get; set; } Property Value Type Description String | Improve this Doc View Source IsHttps Is Https? Declaration public bool IsHttps { get; } Property Value Type Description Boolean | Improve this Doc View Source IsMultipartFormData Does this request contain multipart/form-data? Declaration public bool IsMultipartFormData { get; } Property Value Type Description Boolean | Improve this Doc View Source Method Request Method. Declaration public string Method { get; set; } Property Value Type Description String | Improve this Doc View Source OriginalUrl The original request Url. Declaration public string OriginalUrl { get; } Property Value Type Description String | Improve this Doc View Source RequestUri Request HTTP Uri. Declaration public Uri RequestUri { get; set; } Property Value Type Description Uri | Improve this Doc View Source RequestUriString The request uri as it is in the HTTP header Declaration public string RequestUriString { get; set; } Property Value Type Description String | Improve this Doc View Source UpgradeToWebSocket Does this request has an upgrade to websocket header? Declaration public bool UpgradeToWebSocket { get; } Property Value Type Description Boolean | Improve this Doc View Source Url Request Url. Declaration public string Url { get; } Property Value Type Description String" + "keywords": "Class Request Http(s) request object Inheritance Object RequestResponseBase Request ConnectRequest Inherited Members RequestResponseBase.BodyInternal RequestResponseBase.KeepBody RequestResponseBase.HttpVersion RequestResponseBase.Headers RequestResponseBase.ContentLength RequestResponseBase.ContentEncoding RequestResponseBase.Encoding RequestResponseBase.ContentType RequestResponseBase.IsChunked RequestResponseBase.Body RequestResponseBase.BodyString RequestResponseBase.IsBodyRead RequestResponseBase.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Http Assembly : Titanium.Web.Proxy.dll Syntax [TypeConverter(typeof(ExpandableObjectConverter))] public class Request : RequestResponseBase Properties | Improve this Doc View Source ExpectationFailed Did server respond negatively for 100 continue request? Declaration public bool ExpectationFailed { get; } Property Value Type Description Boolean | Improve this Doc View Source ExpectationSucceeded Did server respond positively for 100 continue request? Declaration public bool ExpectationSucceeded { get; } Property Value Type Description Boolean | Improve this Doc View Source ExpectContinue Does this request has a 100-continue header? Declaration public bool ExpectContinue { get; } Property Value Type Description Boolean | Improve this Doc View Source HasBody Has request body? Declaration public override bool HasBody { get; } Property Value Type Description Boolean Overrides RequestResponseBase.HasBody | Improve this Doc View Source HeaderText Gets the header text. Declaration public override string HeaderText { get; } Property Value Type Description String Overrides RequestResponseBase.HeaderText | Improve this Doc View Source Host Http hostname header value if exists. Note: Changing this does NOT change host in RequestUri. Users can set new RequestUri separately. Declaration public string Host { get; set; } Property Value Type Description String | Improve this Doc View Source IsHttps Is Https? Declaration public bool IsHttps { get; } Property Value Type Description Boolean | Improve this Doc View Source IsMultipartFormData Does this request contain multipart/form-data? Declaration public bool IsMultipartFormData { get; } Property Value Type Description Boolean | Improve this Doc View Source Method Request Method. Declaration public string Method { get; set; } Property Value Type Description String | Improve this Doc View Source RequestUri Request HTTP Uri. Declaration public Uri RequestUri { get; set; } Property Value Type Description Uri | Improve this Doc View Source RequestUriString The request uri as it is in the HTTP header Declaration public string RequestUriString { get; set; } Property Value Type Description String | Improve this Doc View Source UpgradeToWebSocket Does this request has an upgrade to websocket header? Declaration public bool UpgradeToWebSocket { get; } Property Value Type Description Boolean | Improve this Doc View Source Url The request url as it is in the HTTP header Declaration public string Url { get; set; } Property Value Type Description String" }, "api/Titanium.Web.Proxy.Http.RequestResponseBase.html": { "href": "api/Titanium.Web.Proxy.Http.RequestResponseBase.html", "title": "Class RequestResponseBase | Titanium Web Proxy", - "keywords": "Class RequestResponseBase Abstract base class for similar objects shared by both request and response objects. Inheritance Object RequestResponseBase Request Response Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Namespace : Titanium.Web.Proxy.Http Assembly : Titanium.Web.Proxy.dll Syntax public abstract class RequestResponseBase Properties | Improve this Doc View Source Body Body as byte array Declaration [Browsable(false)] public byte[] Body { get; } Property Value Type Description Byte [] | Improve this Doc View Source BodyInternal Cached body content as byte array. Declaration protected byte[] BodyInternal { get; } Property Value Type Description Byte [] | Improve this Doc View Source BodyString Body as string. Use the encoding specified to decode the byte[] data to string Declaration [Browsable(false)] public string BodyString { get; } Property Value Type Description String | Improve this Doc View Source ContentEncoding Content encoding for this request/response. Declaration public string ContentEncoding { get; } Property Value Type Description String | Improve this Doc View Source ContentLength Length of the body. Declaration public long ContentLength { get; set; } Property Value Type Description Int64 | Improve this Doc View Source ContentType Content-type of the request/response. Declaration public string ContentType { get; set; } Property Value Type Description String | Improve this Doc View Source Encoding Encoding for this request/response. Declaration public Encoding Encoding { get; } Property Value Type Description Encoding | Improve this Doc View Source HasBody Has the request/response body? Declaration public abstract bool HasBody { get; } Property Value Type Description Boolean | Improve this Doc View Source Headers Collection of all headers. Declaration public HeaderCollection Headers { get; } Property Value Type Description HeaderCollection | Improve this Doc View Source HeaderText The header text. Declaration public abstract string HeaderText { get; } Property Value Type Description String | Improve this Doc View Source HttpVersion Http Version. Declaration public Version HttpVersion { get; set; } Property Value Type Description Version | Improve this Doc View Source IsBodyRead Was the body read by user? Declaration public bool IsBodyRead { get; } Property Value Type Description Boolean | Improve this Doc View Source IsChunked Is body send as chunked bytes. Declaration public bool IsChunked { get; set; } Property Value Type Description Boolean | Improve this Doc View Source KeepBody Keeps the body data after the session is finished. Declaration public bool KeepBody { get; set; } Property Value Type Description Boolean Methods | Improve this Doc View Source ToString() Declaration public override string ToString() Returns Type Description String Overrides Object.ToString()" + "keywords": "Class RequestResponseBase Abstract base class for similar objects shared by both request and response objects. Inheritance Object RequestResponseBase Request Response Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Http Assembly : Titanium.Web.Proxy.dll Syntax public abstract class RequestResponseBase Properties | Improve this Doc View Source Body Body as byte array Declaration [Browsable(false)] public byte[] Body { get; } Property Value Type Description Byte [] | Improve this Doc View Source BodyInternal Cached body content as byte array. Declaration protected byte[] BodyInternal { get; } Property Value Type Description Byte [] | Improve this Doc View Source BodyString Body as string. Use the encoding specified to decode the byte[] data to string Declaration [Browsable(false)] public string BodyString { get; } Property Value Type Description String | Improve this Doc View Source ContentEncoding Content encoding for this request/response. Declaration public string ContentEncoding { get; } Property Value Type Description String | Improve this Doc View Source ContentLength Length of the body. Declaration public long ContentLength { get; set; } Property Value Type Description Int64 | Improve this Doc View Source ContentType Content-type of the request/response. Declaration public string ContentType { get; set; } Property Value Type Description String | Improve this Doc View Source Encoding Encoding for this request/response. Declaration public Encoding Encoding { get; } Property Value Type Description Encoding | Improve this Doc View Source HasBody Has the request/response body? Declaration public abstract bool HasBody { get; } Property Value Type Description Boolean | Improve this Doc View Source Headers Collection of all headers. Declaration public HeaderCollection Headers { get; } Property Value Type Description HeaderCollection | Improve this Doc View Source HeaderText The header text. Declaration public abstract string HeaderText { get; } Property Value Type Description String | Improve this Doc View Source HttpVersion Http Version. Declaration public Version HttpVersion { get; set; } Property Value Type Description Version | Improve this Doc View Source IsBodyRead Was the body read by user? Declaration public bool IsBodyRead { get; } Property Value Type Description Boolean | Improve this Doc View Source IsChunked Is body send as chunked bytes. Declaration public bool IsChunked { get; set; } Property Value Type Description Boolean | Improve this Doc View Source KeepBody Keeps the body data after the session is finished. Declaration public bool KeepBody { get; set; } Property Value Type Description Boolean Methods | Improve this Doc View Source ToString() Declaration public override string ToString() Returns Type Description String Overrides Object.ToString()" }, "api/Titanium.Web.Proxy.Http.Response.html": { "href": "api/Titanium.Web.Proxy.Http.Response.html", "title": "Class Response | Titanium Web Proxy", - "keywords": "Class Response Http(s) response object Inheritance Object RequestResponseBase Response ConnectResponse GenericResponse OkResponse RedirectResponse Inherited Members RequestResponseBase.BodyInternal RequestResponseBase.KeepBody RequestResponseBase.HttpVersion RequestResponseBase.Headers RequestResponseBase.ContentLength RequestResponseBase.ContentEncoding RequestResponseBase.Encoding RequestResponseBase.ContentType RequestResponseBase.IsChunked RequestResponseBase.Body RequestResponseBase.BodyString RequestResponseBase.IsBodyRead RequestResponseBase.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Namespace : Titanium.Web.Proxy.Http Assembly : Titanium.Web.Proxy.dll Syntax [TypeConverter(typeof(ExpandableObjectConverter))] public class Response : RequestResponseBase Constructors | Improve this Doc View Source Response() Constructor. Declaration public Response() | Improve this Doc View Source Response(Byte[]) Constructor. Declaration public Response(byte[] body) Parameters Type Name Description Byte [] body Properties | Improve this Doc View Source HasBody Has response body? Declaration public override bool HasBody { get; } Property Value Type Description Boolean Overrides RequestResponseBase.HasBody | Improve this Doc View Source HeaderText Gets the header text. Declaration public override string HeaderText { get; } Property Value Type Description String Overrides RequestResponseBase.HeaderText | Improve this Doc View Source KeepAlive Keep the connection alive? Declaration public bool KeepAlive { get; } Property Value Type Description Boolean | Improve this Doc View Source StatusCode Response Status Code. Declaration public int StatusCode { get; set; } Property Value Type Description Int32 | Improve this Doc View Source StatusDescription Response Status description. Declaration public string StatusDescription { get; set; } Property Value Type Description String" + "keywords": "Class Response Http(s) response object Inheritance Object RequestResponseBase Response ConnectResponse GenericResponse OkResponse RedirectResponse Inherited Members RequestResponseBase.BodyInternal RequestResponseBase.KeepBody RequestResponseBase.HttpVersion RequestResponseBase.Headers RequestResponseBase.ContentLength RequestResponseBase.ContentEncoding RequestResponseBase.Encoding RequestResponseBase.ContentType RequestResponseBase.IsChunked RequestResponseBase.Body RequestResponseBase.BodyString RequestResponseBase.IsBodyRead RequestResponseBase.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Http Assembly : Titanium.Web.Proxy.dll Syntax [TypeConverter(typeof(ExpandableObjectConverter))] public class Response : RequestResponseBase Constructors | Improve this Doc View Source Response() Constructor. Declaration public Response() | Improve this Doc View Source Response(Byte[]) Constructor. Declaration public Response(byte[] body) Parameters Type Name Description Byte [] body Properties | Improve this Doc View Source HasBody Has response body? Declaration public override bool HasBody { get; } Property Value Type Description Boolean Overrides RequestResponseBase.HasBody | Improve this Doc View Source HeaderText Gets the header text. Declaration public override string HeaderText { get; } Property Value Type Description String Overrides RequestResponseBase.HeaderText | Improve this Doc View Source KeepAlive Keep the connection alive? Declaration public bool KeepAlive { get; } Property Value Type Description Boolean | Improve this Doc View Source StatusCode Response Status Code. Declaration public int StatusCode { get; set; } Property Value Type Description Int32 | Improve this Doc View Source StatusDescription Response Status description. Declaration public string StatusDescription { get; set; } Property Value Type Description String" }, "api/Titanium.Web.Proxy.Http.Responses.GenericResponse.html": { "href": "api/Titanium.Web.Proxy.Http.Responses.GenericResponse.html", "title": "Class GenericResponse | Titanium Web Proxy", - "keywords": "Class GenericResponse Anything other than a 200 or 302 http response. Inheritance Object RequestResponseBase Response GenericResponse Inherited Members Response.StatusCode Response.StatusDescription Response.HasBody Response.KeepAlive Response.HeaderText RequestResponseBase.BodyInternal RequestResponseBase.KeepBody RequestResponseBase.HttpVersion RequestResponseBase.Headers RequestResponseBase.ContentLength RequestResponseBase.ContentEncoding RequestResponseBase.Encoding RequestResponseBase.ContentType RequestResponseBase.IsChunked RequestResponseBase.Body RequestResponseBase.BodyString RequestResponseBase.IsBodyRead RequestResponseBase.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Namespace : Titanium.Web.Proxy.Http.Responses Assembly : Titanium.Web.Proxy.dll Syntax public class GenericResponse : Response Constructors | Improve this Doc View Source GenericResponse(Int32, String) Constructor. Declaration public GenericResponse(int statusCode, string statusDescription) Parameters Type Name Description Int32 statusCode String statusDescription | Improve this Doc View Source GenericResponse(HttpStatusCode) Constructor. Declaration public GenericResponse(HttpStatusCode status) Parameters Type Name Description HttpStatusCode status" + "keywords": "Class GenericResponse Anything other than a 200 or 302 http response. Inheritance Object RequestResponseBase Response GenericResponse Inherited Members Response.StatusCode Response.StatusDescription Response.HasBody Response.KeepAlive Response.HeaderText RequestResponseBase.BodyInternal RequestResponseBase.KeepBody RequestResponseBase.HttpVersion RequestResponseBase.Headers RequestResponseBase.ContentLength RequestResponseBase.ContentEncoding RequestResponseBase.Encoding RequestResponseBase.ContentType RequestResponseBase.IsChunked RequestResponseBase.Body RequestResponseBase.BodyString RequestResponseBase.IsBodyRead RequestResponseBase.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Http.Responses Assembly : Titanium.Web.Proxy.dll Syntax public class GenericResponse : Response Constructors | Improve this Doc View Source GenericResponse(Int32, String) Constructor. Declaration public GenericResponse(int statusCode, string statusDescription) Parameters Type Name Description Int32 statusCode String statusDescription | Improve this Doc View Source GenericResponse(HttpStatusCode) Constructor. Declaration public GenericResponse(HttpStatusCode status) Parameters Type Name Description HttpStatusCode status" }, "api/Titanium.Web.Proxy.Http.Responses.html": { "href": "api/Titanium.Web.Proxy.Http.Responses.html", @@ -157,32 +157,22 @@ "api/Titanium.Web.Proxy.Http.Responses.OkResponse.html": { "href": "api/Titanium.Web.Proxy.Http.Responses.OkResponse.html", "title": "Class OkResponse | Titanium Web Proxy", - "keywords": "Class OkResponse The http 200 Ok response. Inheritance Object RequestResponseBase Response OkResponse Inherited Members Response.StatusCode Response.StatusDescription Response.HasBody Response.KeepAlive Response.HeaderText RequestResponseBase.BodyInternal RequestResponseBase.KeepBody RequestResponseBase.HttpVersion RequestResponseBase.Headers RequestResponseBase.ContentLength RequestResponseBase.ContentEncoding RequestResponseBase.Encoding RequestResponseBase.ContentType RequestResponseBase.IsChunked RequestResponseBase.Body RequestResponseBase.BodyString RequestResponseBase.IsBodyRead RequestResponseBase.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Namespace : Titanium.Web.Proxy.Http.Responses Assembly : Titanium.Web.Proxy.dll Syntax public sealed class OkResponse : Response Constructors | Improve this Doc View Source OkResponse() Constructor. Declaration public OkResponse() | Improve this Doc View Source OkResponse(Byte[]) Constructor. Declaration public OkResponse(byte[] body) Parameters Type Name Description Byte [] body" + "keywords": "Class OkResponse The http 200 Ok response. Inheritance Object RequestResponseBase Response OkResponse Inherited Members Response.StatusCode Response.StatusDescription Response.HasBody Response.KeepAlive Response.HeaderText RequestResponseBase.BodyInternal RequestResponseBase.KeepBody RequestResponseBase.HttpVersion RequestResponseBase.Headers RequestResponseBase.ContentLength RequestResponseBase.ContentEncoding RequestResponseBase.Encoding RequestResponseBase.ContentType RequestResponseBase.IsChunked RequestResponseBase.Body RequestResponseBase.BodyString RequestResponseBase.IsBodyRead RequestResponseBase.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Http.Responses Assembly : Titanium.Web.Proxy.dll Syntax public sealed class OkResponse : Response Constructors | Improve this Doc View Source OkResponse() Constructor. Declaration public OkResponse() | Improve this Doc View Source OkResponse(Byte[]) Constructor. Declaration public OkResponse(byte[] body) Parameters Type Name Description Byte [] body" }, "api/Titanium.Web.Proxy.Http.Responses.RedirectResponse.html": { "href": "api/Titanium.Web.Proxy.Http.Responses.RedirectResponse.html", "title": "Class RedirectResponse | Titanium Web Proxy", - "keywords": "Class RedirectResponse The http redirect response. Inheritance Object RequestResponseBase Response RedirectResponse Inherited Members Response.StatusCode Response.StatusDescription Response.HasBody Response.KeepAlive Response.HeaderText RequestResponseBase.BodyInternal RequestResponseBase.KeepBody RequestResponseBase.HttpVersion RequestResponseBase.Headers RequestResponseBase.ContentLength RequestResponseBase.ContentEncoding RequestResponseBase.Encoding RequestResponseBase.ContentType RequestResponseBase.IsChunked RequestResponseBase.Body RequestResponseBase.BodyString RequestResponseBase.IsBodyRead RequestResponseBase.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Namespace : Titanium.Web.Proxy.Http.Responses Assembly : Titanium.Web.Proxy.dll Syntax public sealed class RedirectResponse : Response Constructors | Improve this Doc View Source RedirectResponse() Initializes a new instance of the RedirectResponse class. Declaration public RedirectResponse()" - }, - "api/Titanium.Web.Proxy.Http2.Hpack.Decoder.html": { - "href": "api/Titanium.Web.Proxy.Http2.Hpack.Decoder.html", - "title": "Class Decoder | Titanium Web Proxy", - "keywords": "Class Decoder Inheritance Object Decoder Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Titanium.Web.Proxy.Http2.Hpack Assembly : Titanium.Web.Proxy.dll Syntax public class Decoder Constructors | Improve this Doc View Source Decoder(Int32, Int32) Initializes a new instance of the Decoder class. Declaration public Decoder(int maxHeaderSize, int maxHeaderTableSize) Parameters Type Name Description Int32 maxHeaderSize Max header size. Int32 maxHeaderTableSize Max header table size. Methods | Improve this Doc View Source Decode(BinaryReader, IHeaderListener) Decode the header block into header fields. Declaration public void Decode(BinaryReader input, IHeaderListener headerListener) Parameters Type Name Description BinaryReader input Input. IHeaderListener headerListener Header listener. | Improve this Doc View Source EndHeaderBlock() End the current header block. Returns if the header field has been truncated. This must be called after the header block has been completely decoded. Declaration public bool EndHeaderBlock() Returns Type Description Boolean true , if header block was ended, false otherwise. | Improve this Doc View Source GetMaxHeaderTableSize() Return the maximum table size. This is the maximum size allowed by both the encoder and the decoder. Declaration public int GetMaxHeaderTableSize() Returns Type Description Int32 The max header table size. | Improve this Doc View Source SetMaxHeaderTableSize(Int32) Set the maximum table size. If this is below the maximum size of the dynamic table used by the encoder, the beginning of the next header block MUST signal this change. Declaration public void SetMaxHeaderTableSize(int maxHeaderTableSize) Parameters Type Name Description Int32 maxHeaderTableSize Max header table size." + "keywords": "Class RedirectResponse The http redirect response. Inheritance Object RequestResponseBase Response RedirectResponse Inherited Members Response.StatusCode Response.StatusDescription Response.HasBody Response.KeepAlive Response.HeaderText RequestResponseBase.BodyInternal RequestResponseBase.KeepBody RequestResponseBase.HttpVersion RequestResponseBase.Headers RequestResponseBase.ContentLength RequestResponseBase.ContentEncoding RequestResponseBase.Encoding RequestResponseBase.ContentType RequestResponseBase.IsChunked RequestResponseBase.Body RequestResponseBase.BodyString RequestResponseBase.IsBodyRead RequestResponseBase.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Http.Responses Assembly : Titanium.Web.Proxy.dll Syntax public sealed class RedirectResponse : Response Constructors | Improve this Doc View Source RedirectResponse() Initializes a new instance of the RedirectResponse class. Declaration public RedirectResponse()" }, "api/Titanium.Web.Proxy.Http2.Hpack.DynamicTable.html": { "href": "api/Titanium.Web.Proxy.Http2.Hpack.DynamicTable.html", "title": "Class DynamicTable | Titanium Web Proxy", - "keywords": "Class DynamicTable Inheritance Object DynamicTable Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Titanium.Web.Proxy.Http2.Hpack Assembly : Titanium.Web.Proxy.dll Syntax public class DynamicTable Constructors | Improve this Doc View Source DynamicTable(Int32) Creates a new dynamic table with the specified initial capacity. Declaration public DynamicTable(int initialCapacity) Parameters Type Name Description Int32 initialCapacity Initial capacity. Properties | Improve this Doc View Source Capacity Return the maximum allowable size of the dynamic table. Declaration public int Capacity { get; } Property Value Type Description Int32 The capacity. | Improve this Doc View Source Size Return the current size of the dynamic table. This is the sum of the size of the entries. Declaration public int Size { get; } Property Value Type Description Int32 The size. Methods | Improve this Doc View Source Add(HttpHeader) Add the header field to the dynamic table. Entries are evicted from the dynamic table until the size of the table and the new header field is less than or equal to the table's capacity. If the size of the new entry is larger than the table's capacity, the dynamic table will be cleared. Declaration public void Add(HttpHeader header) Parameters Type Name Description HttpHeader header Header. | Improve this Doc View Source Clear() Remove all entries from the dynamic table. Declaration public void Clear() | Improve this Doc View Source GetEntry(Int32) Return the header field at the given index. The first and newest entry is always at index 1, and the oldest entry is at the index length(). Declaration public HttpHeader GetEntry(int index) Parameters Type Name Description Int32 index Index. Returns Type Description HttpHeader The entry. | Improve this Doc View Source Length() Return the number of header fields in the dynamic table. Declaration public int Length() Returns Type Description Int32 | Improve this Doc View Source Remove() Remove and return the oldest header field from the dynamic table. Declaration public HttpHeader Remove() Returns Type Description HttpHeader | Improve this Doc View Source SetCapacity(Int32) Set the maximum size of the dynamic table. Entries are evicted from the dynamic table until the size of the table is less than or equal to the maximum size. Declaration public void SetCapacity(int capacity) Parameters Type Name Description Int32 capacity Capacity." - }, - "api/Titanium.Web.Proxy.Http2.Hpack.Encoder.html": { - "href": "api/Titanium.Web.Proxy.Http2.Hpack.Encoder.html", - "title": "Class Encoder | Titanium Web Proxy", - "keywords": "Class Encoder Inheritance Object Encoder Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Titanium.Web.Proxy.Http2.Hpack Assembly : Titanium.Web.Proxy.dll Syntax public class Encoder Constructors | Improve this Doc View Source Encoder(Int32) Initializes a new instance of the Encoder class. Declaration public Encoder(int maxHeaderTableSize) Parameters Type Name Description Int32 maxHeaderTableSize Max header table size. Properties | Improve this Doc View Source MaxHeaderTableSize Gets the the maximum table size. Declaration public int MaxHeaderTableSize { get; } Property Value Type Description Int32 The max header table size. Methods | Improve this Doc View Source EncodeHeader(BinaryWriter, String, String, Boolean, HpackUtil.IndexType, Boolean) Encode the header field into the header block. Declaration public void EncodeHeader(BinaryWriter output, string name, string value, bool sensitive = false, HpackUtil.IndexType indexType = HpackUtil.IndexType.Incremental, bool useStaticName = true) Parameters Type Name Description BinaryWriter output Output. String name Name. String value Value. Boolean sensitive If set to true sensitive. HpackUtil.IndexType indexType Index type. Boolean useStaticName Use static name. | Improve this Doc View Source SetMaxHeaderTableSize(BinaryWriter, Int32) Set the maximum table size. Declaration public void SetMaxHeaderTableSize(BinaryWriter output, int maxHeaderTableSize) Parameters Type Name Description BinaryWriter output Output. Int32 maxHeaderTableSize Max header table size." + "keywords": "Class DynamicTable Inheritance Object DynamicTable Inherited Members Object.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Http2.Hpack Assembly : Titanium.Web.Proxy.dll Syntax public class DynamicTable Constructors | Improve this Doc View Source DynamicTable(Int32) Creates a new dynamic table with the specified initial capacity. Declaration public DynamicTable(int initialCapacity) Parameters Type Name Description Int32 initialCapacity Initial capacity. Properties | Improve this Doc View Source Capacity Return the maximum allowable size of the dynamic table. Declaration public int Capacity { get; } Property Value Type Description Int32 The capacity. | Improve this Doc View Source Size Return the current size of the dynamic table. This is the sum of the size of the entries. Declaration public int Size { get; } Property Value Type Description Int32 The size. Methods | Improve this Doc View Source Add(HttpHeader) Add the header field to the dynamic table. Entries are evicted from the dynamic table until the size of the table and the new header field is less than or equal to the table's capacity. If the size of the new entry is larger than the table's capacity, the dynamic table will be cleared. Declaration public void Add(HttpHeader header) Parameters Type Name Description HttpHeader header Header. | Improve this Doc View Source Clear() Remove all entries from the dynamic table. Declaration public void Clear() | Improve this Doc View Source GetEntry(Int32) Return the header field at the given index. The first and newest entry is always at index 1, and the oldest entry is at the index length(). Declaration public HttpHeader GetEntry(int index) Parameters Type Name Description Int32 index Index. Returns Type Description HttpHeader The entry. | Improve this Doc View Source Length() Return the number of header fields in the dynamic table. Declaration public int Length() Returns Type Description Int32 | Improve this Doc View Source Remove() Remove and return the oldest header field from the dynamic table. Declaration public HttpHeader Remove() Returns Type Description HttpHeader | Improve this Doc View Source SetCapacity(Int32) Set the maximum size of the dynamic table. Entries are evicted from the dynamic table until the size of the table is less than or equal to the maximum size. Declaration public void SetCapacity(int capacity) Parameters Type Name Description Int32 capacity Capacity." }, "api/Titanium.Web.Proxy.Http2.Hpack.HpackUtil.html": { "href": "api/Titanium.Web.Proxy.Http2.Hpack.HpackUtil.html", "title": "Class HpackUtil | Titanium Web Proxy", - "keywords": "Class HpackUtil Inheritance Object HpackUtil Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Titanium.Web.Proxy.Http2.Hpack Assembly : Titanium.Web.Proxy.dll Syntax public static class HpackUtil Fields | Improve this Doc View Source HuffmanCodeLengths Declaration public static readonly byte[] HuffmanCodeLengths Field Value Type Description Byte [] | Improve this Doc View Source HuffmanCodes Declaration public static readonly int[] HuffmanCodes Field Value Type Description Int32 [] | Improve this Doc View Source HuffmanEos Declaration public const int HuffmanEos = 256 Field Value Type Description Int32" + "keywords": "Class HpackUtil Inheritance Object HpackUtil Inherited Members Object.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Http2.Hpack Assembly : Titanium.Web.Proxy.dll Syntax public static class HpackUtil Fields | Improve this Doc View Source HuffmanCodeLengths Declaration public static readonly byte[] HuffmanCodeLengths Field Value Type Description Byte [] | Improve this Doc View Source HuffmanCodes Declaration public static readonly int[] HuffmanCodes Field Value Type Description Int32 [] | Improve this Doc View Source HuffmanEos Declaration public const int HuffmanEos = 256 Field Value Type Description Int32" }, "api/Titanium.Web.Proxy.Http2.Hpack.HpackUtil.IndexType.html": { "href": "api/Titanium.Web.Proxy.Http2.Hpack.HpackUtil.IndexType.html", @@ -192,52 +182,42 @@ "api/Titanium.Web.Proxy.Http2.Hpack.html": { "href": "api/Titanium.Web.Proxy.Http2.Hpack.html", "title": "Namespace Titanium.Web.Proxy.Http2.Hpack | Titanium Web Proxy", - "keywords": "Namespace Titanium.Web.Proxy.Http2.Hpack Classes Decoder DynamicTable Encoder HpackUtil HuffmanDecoder HuffmanEncoder StaticTable Interfaces IHeaderListener Enums HpackUtil.IndexType" + "keywords": "Namespace Titanium.Web.Proxy.Http2.Hpack Classes DynamicTable HpackUtil HuffmanDecoder Enums HpackUtil.IndexType" }, "api/Titanium.Web.Proxy.Http2.Hpack.HuffmanDecoder.html": { "href": "api/Titanium.Web.Proxy.Http2.Hpack.HuffmanDecoder.html", "title": "Class HuffmanDecoder | Titanium Web Proxy", - "keywords": "Class HuffmanDecoder Inheritance Object HuffmanDecoder Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Titanium.Web.Proxy.Http2.Hpack Assembly : Titanium.Web.Proxy.dll Syntax public class HuffmanDecoder Fields | Improve this Doc View Source Instance Huffman Decoder Declaration public static readonly HuffmanDecoder Instance Field Value Type Description HuffmanDecoder Methods | Improve this Doc View Source Decode(Byte[]) Decompresses the given Huffman coded string literal. Declaration public string Decode(byte[] buf) Parameters Type Name Description Byte [] buf the string literal to be decoded Returns Type Description String the output stream for the compressed data Exceptions Type Condition IOException throws IOException if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed." - }, - "api/Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.html": { - "href": "api/Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.html", - "title": "Class HuffmanEncoder | Titanium Web Proxy", - "keywords": "Class HuffmanEncoder Inheritance Object HuffmanEncoder Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Titanium.Web.Proxy.Http2.Hpack Assembly : Titanium.Web.Proxy.dll Syntax public class HuffmanEncoder Fields | Improve this Doc View Source Instance Huffman Encoder Declaration public static readonly HuffmanEncoder Instance Field Value Type Description HuffmanEncoder Methods | Improve this Doc View Source Encode(BinaryWriter, Byte[]) Compresses the input string literal using the Huffman coding. Declaration public void Encode(BinaryWriter output, byte[] data) Parameters Type Name Description BinaryWriter output the output stream for the compressed data Byte [] data the string literal to be Huffman encoded Exceptions Type Condition IOException if an I/O error occurs. | Improve this Doc View Source Encode(BinaryWriter, Byte[], Int32, Int32) Compresses the input string literal using the Huffman coding. Declaration public void Encode(BinaryWriter output, byte[] data, int off, int len) Parameters Type Name Description BinaryWriter output the output stream for the compressed data Byte [] data the string literal to be Huffman encoded Int32 off the start offset in the data Int32 len the number of bytes to encode Exceptions Type Condition IOException if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed. | Improve this Doc View Source GetEncodedLength(Byte[]) Returns the number of bytes required to Huffman encode the input string literal. Declaration public int GetEncodedLength(byte[] data) Parameters Type Name Description Byte [] data the string literal to be Huffman encoded Returns Type Description Int32 the number of bytes required to Huffman encode data" - }, - "api/Titanium.Web.Proxy.Http2.Hpack.IHeaderListener.html": { - "href": "api/Titanium.Web.Proxy.Http2.Hpack.IHeaderListener.html", - "title": "Interface IHeaderListener | Titanium Web Proxy", - "keywords": "Interface IHeaderListener Namespace : Titanium.Web.Proxy.Http2.Hpack Assembly : Titanium.Web.Proxy.dll Syntax public interface IHeaderListener Methods | Improve this Doc View Source AddHeader(String, String, Boolean) EmitHeader is called by the decoder during header field emission. The name and value byte arrays must not be modified. Declaration void AddHeader(string name, string value, bool sensitive) Parameters Type Name Description String name Name. String value Value. Boolean sensitive If set to true sensitive." - }, - "api/Titanium.Web.Proxy.Http2.Hpack.StaticTable.html": { - "href": "api/Titanium.Web.Proxy.Http2.Hpack.StaticTable.html", - "title": "Class StaticTable | Titanium Web Proxy", - "keywords": "Class StaticTable Inheritance Object StaticTable Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Titanium.Web.Proxy.Http2.Hpack Assembly : Titanium.Web.Proxy.dll Syntax public static class StaticTable Properties | Improve this Doc View Source Length The number of header fields in the static table. Declaration public static int Length { get; } Property Value Type Description Int32 The length. Methods | Improve this Doc View Source Get(Int32) Return the http header field at the given index value. Declaration public static HttpHeader Get(int index) Parameters Type Name Description Int32 index Index. Returns Type Description HttpHeader The header field. | Improve this Doc View Source GetIndex(String) Returns the lowest index value for the given header field name in the static table. Returns -1 if the header field name is not in the static table. Declaration public static int GetIndex(string name) Parameters Type Name Description String name Name. Returns Type Description Int32 The index. | Improve this Doc View Source GetIndex(String, String) Returns the index value for the given header field in the static table. Returns -1 if the header field is not in the static table. Declaration public static int GetIndex(string name, string value) Parameters Type Name Description String name Name. String value Value. Returns Type Description Int32 The index." + "keywords": "Class HuffmanDecoder Inheritance Object HuffmanDecoder Inherited Members Object.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Http2.Hpack Assembly : Titanium.Web.Proxy.dll Syntax public class HuffmanDecoder Fields | Improve this Doc View Source Instance Huffman Decoder Declaration public static readonly HuffmanDecoder Instance Field Value Type Description HuffmanDecoder Methods | Improve this Doc View Source Decode(Byte[]) Decompresses the given Huffman coded string literal. Declaration public ReadOnlyMemory Decode(byte[] buf) Parameters Type Name Description Byte [] buf the string literal to be decoded Returns Type Description ReadOnlyMemory < Byte > the output stream for the compressed data Exceptions Type Condition IOException throws IOException if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed." }, "api/Titanium.Web.Proxy.Models.ExplicitProxyEndPoint.html": { "href": "api/Titanium.Web.Proxy.Models.ExplicitProxyEndPoint.html", "title": "Class ExplicitProxyEndPoint | Titanium Web Proxy", - "keywords": "Class ExplicitProxyEndPoint A proxy endpoint that the client is aware of. So client application know that it is communicating with a proxy server. Inheritance Object ProxyEndPoint ExplicitProxyEndPoint Inherited Members ProxyEndPoint.IpAddress ProxyEndPoint.Port ProxyEndPoint.DecryptSsl ProxyEndPoint.GenericCertificate Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Titanium.Web.Proxy.Models Assembly : Titanium.Web.Proxy.dll Syntax public class ExplicitProxyEndPoint : ProxyEndPoint Constructors | Improve this Doc View Source ExplicitProxyEndPoint(IPAddress, Int32, Boolean) Constructor. Declaration public ExplicitProxyEndPoint(IPAddress ipAddress, int port, bool decryptSsl = true) Parameters Type Name Description IPAddress ipAddress Listening IP address. Int32 port Listening port. Boolean decryptSsl Should we decrypt ssl? Events | Improve this Doc View Source BeforeTunnelConnectRequest Intercept tunnel connect request. Valid only for explicit endpoints. Set the DecryptSsl property to false if this HTTP connect request shouldn't be decrypted and instead be relayed. Declaration public event AsyncEventHandler BeforeTunnelConnectRequest Event Type Type Description AsyncEventHandler < TunnelConnectSessionEventArgs > | Improve this Doc View Source BeforeTunnelConnectResponse Intercept tunnel connect response. Valid only for explicit endpoints. Declaration public event AsyncEventHandler BeforeTunnelConnectResponse Event Type Type Description AsyncEventHandler < TunnelConnectSessionEventArgs >" + "keywords": "Class ExplicitProxyEndPoint A proxy endpoint that the client is aware of. So client application know that it is communicating with a proxy server. Inheritance Object ProxyEndPoint ExplicitProxyEndPoint Inherited Members ProxyEndPoint.IpAddress ProxyEndPoint.Port ProxyEndPoint.DecryptSsl ProxyEndPoint.GenericCertificate Object.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Models Assembly : Titanium.Web.Proxy.dll Syntax public class ExplicitProxyEndPoint : ProxyEndPoint Constructors | Improve this Doc View Source ExplicitProxyEndPoint(IPAddress, Int32, Boolean) Constructor. Declaration public ExplicitProxyEndPoint(IPAddress ipAddress, int port, bool decryptSsl = true) Parameters Type Name Description IPAddress ipAddress Listening IP address. Int32 port Listening port. Boolean decryptSsl Should we decrypt ssl? Events | Improve this Doc View Source BeforeTunnelConnectRequest Intercept tunnel connect request. Valid only for explicit endpoints. Set the DecryptSsl property to false if this HTTP connect request shouldn't be decrypted and instead be relayed. Declaration public event AsyncEventHandler BeforeTunnelConnectRequest Event Type Type Description AsyncEventHandler < TunnelConnectSessionEventArgs > | Improve this Doc View Source BeforeTunnelConnectResponse Intercept tunnel connect response. Valid only for explicit endpoints. Declaration public event AsyncEventHandler BeforeTunnelConnectResponse Event Type Type Description AsyncEventHandler < TunnelConnectSessionEventArgs >" }, "api/Titanium.Web.Proxy.Models.ExternalProxy.html": { "href": "api/Titanium.Web.Proxy.Models.ExternalProxy.html", "title": "Class ExternalProxy | Titanium Web Proxy", - "keywords": "Class ExternalProxy An upstream proxy this proxy uses if any. Inheritance Object ExternalProxy Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Namespace : Titanium.Web.Proxy.Models Assembly : Titanium.Web.Proxy.dll Syntax public class ExternalProxy Properties | Improve this Doc View Source BypassLocalhost Bypass this proxy for connections to localhost? Declaration public bool BypassLocalhost { get; set; } Property Value Type Description Boolean | Improve this Doc View Source HostName Host name. Declaration public string HostName { get; set; } Property Value Type Description String | Improve this Doc View Source Password Password. Declaration public string Password { get; set; } Property Value Type Description String | Improve this Doc View Source Port Port. Declaration public int Port { get; set; } Property Value Type Description Int32 | Improve this Doc View Source UseDefaultCredentials Use default windows credentials? Declaration public bool UseDefaultCredentials { get; set; } Property Value Type Description Boolean | Improve this Doc View Source UserName Username. Declaration public string UserName { get; set; } Property Value Type Description String Methods | Improve this Doc View Source ToString() returns data in Hostname:port format. Declaration public override string ToString() Returns Type Description String Overrides Object.ToString()" + "keywords": "Class ExternalProxy An upstream proxy this proxy uses if any. Inheritance Object ExternalProxy Namespace : Titanium.Web.Proxy.Models Assembly : Titanium.Web.Proxy.dll Syntax public class ExternalProxy : IExternalProxy Constructors | Improve this Doc View Source ExternalProxy() Initializes a new instance of the ExternalProxy class. Declaration public ExternalProxy() | Improve this Doc View Source ExternalProxy(String, Int32) Initializes a new instance of the ExternalProxy class. Declaration public ExternalProxy(string hostName, int port) Parameters Type Name Description String hostName Name of the host. Int32 port The port. | Improve this Doc View Source ExternalProxy(String, Int32, String, String) Initializes a new instance of the ExternalProxy class. Declaration public ExternalProxy(string hostName, int port, string userName, string password) Parameters Type Name Description String hostName Name of the host. Int32 port The port. String userName Name of the user. String password The password. Properties | Improve this Doc View Source BypassLocalhost Bypass this proxy for connections to localhost? Declaration public bool BypassLocalhost { get; set; } Property Value Type Description Boolean | Improve this Doc View Source HostName Host name. Declaration public string HostName { get; set; } Property Value Type Description String | Improve this Doc View Source Password Password. Declaration public string Password { get; set; } Property Value Type Description String | Improve this Doc View Source Port Port. Declaration public int Port { get; set; } Property Value Type Description Int32 | Improve this Doc View Source ProxyType Declaration public ExternalProxyType ProxyType { get; set; } Property Value Type Description ExternalProxyType | Improve this Doc View Source UseDefaultCredentials Use default windows credentials? Declaration public bool UseDefaultCredentials { get; set; } Property Value Type Description Boolean | Improve this Doc View Source UserName Username. Declaration public string UserName { get; set; } Property Value Type Description String Methods | Improve this Doc View Source ToString() returns data in Hostname:port format. Declaration public override string ToString() Returns Type Description String" + }, + "api/Titanium.Web.Proxy.Models.ExternalProxyType.html": { + "href": "api/Titanium.Web.Proxy.Models.ExternalProxyType.html", + "title": "Enum ExternalProxyType | Titanium Web Proxy", + "keywords": "Enum ExternalProxyType Namespace : Titanium.Web.Proxy.Models Assembly : Titanium.Web.Proxy.dll Syntax public enum ExternalProxyType Fields Name Description Http A HTTP/HTTPS proxy server. Socks4 A SOCKS4[A] proxy server. Socks5 A SOCKS5 proxy server." }, "api/Titanium.Web.Proxy.Models.html": { "href": "api/Titanium.Web.Proxy.Models.html", "title": "Namespace Titanium.Web.Proxy.Models | Titanium Web Proxy", - "keywords": "Namespace Titanium.Web.Proxy.Models Classes ExplicitProxyEndPoint A proxy endpoint that the client is aware of. So client application know that it is communicating with a proxy server. ExternalProxy An upstream proxy this proxy uses if any. HttpHeader Http Header object used by proxy ProxyAuthenticationContext A context container for authentication flows ProxyEndPoint An abstract endpoint where the proxy listens TransparentProxyEndPoint A proxy end point client is not aware of. Useful when requests are redirected to this proxy end point through port forwarding via router. Enums ProxyAuthenticationResult ProxyProtocolType" + "keywords": "Namespace Titanium.Web.Proxy.Models Classes ExplicitProxyEndPoint A proxy endpoint that the client is aware of. So client application know that it is communicating with a proxy server. ExternalProxy An upstream proxy this proxy uses if any. HttpHeader Http Header object used by proxy ProxyAuthenticationContext A context container for authentication flows ProxyEndPoint An abstract endpoint where the proxy listens TransparentProxyEndPoint A proxy end point client is not aware of. Useful when requests are redirected to this proxy end point through port forwarding via router. Enums ExternalProxyType ProxyAuthenticationResult ProxyProtocolType" }, "api/Titanium.Web.Proxy.Models.HttpHeader.html": { "href": "api/Titanium.Web.Proxy.Models.HttpHeader.html", "title": "Class HttpHeader | Titanium Web Proxy", - "keywords": "Class HttpHeader Http Header object used by proxy Inheritance Object HttpHeader Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Namespace : Titanium.Web.Proxy.Models Assembly : Titanium.Web.Proxy.dll Syntax public class HttpHeader Constructors | Improve this Doc View Source HttpHeader(String, String) Initialize a new instance. Declaration public HttpHeader(string name, string value) Parameters Type Name Description String name Header name. String value Header value. | Improve this Doc View Source HttpHeader(String, String, Boolean) Declaration protected HttpHeader(string name, string value, bool headerEntry) Parameters Type Name Description String name String value Boolean headerEntry Fields | Improve this Doc View Source HttpHeaderOverhead HPACK: Header Compression for HTTP/2 Section 4.1. Calculating Table Size The additional 32 octets account for an estimated overhead associated with an entry. Declaration public const int HttpHeaderOverhead = 32 Field Value Type Description Int32 Properties | Improve this Doc View Source Name Header Name. Declaration public string Name { get; } Property Value Type Description String | Improve this Doc View Source Size Declaration public int Size { get; } Property Value Type Description Int32 | Improve this Doc View Source Value Header Value. Declaration public string Value { get; set; } Property Value Type Description String Methods | Improve this Doc View Source SizeOf(String, String) Declaration public static int SizeOf(string name, string value) Parameters Type Name Description String name String value Returns Type Description Int32 | Improve this Doc View Source ToString() Returns header as a valid header string. Declaration public override string ToString() Returns Type Description String Overrides Object.ToString()" + "keywords": "Class HttpHeader Http Header object used by proxy Inheritance Object HttpHeader Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Models Assembly : Titanium.Web.Proxy.dll Syntax public class HttpHeader Constructors | Improve this Doc View Source HttpHeader(String, String) Initialize a new instance. Declaration public HttpHeader(string name, string value) Parameters Type Name Description String name Header name. String value Header value. Fields | Improve this Doc View Source HttpHeaderOverhead HPACK: Header Compression for HTTP/2 Section 4.1. Calculating Table Size The additional 32 octets account for an estimated overhead associated with an entry. Declaration public const int HttpHeaderOverhead = 32 Field Value Type Description Int32 Properties | Improve this Doc View Source Encoding Declaration public static Encoding Encoding { get; } Property Value Type Description Encoding | Improve this Doc View Source Name Header Name. Declaration public string Name { get; } Property Value Type Description String | Improve this Doc View Source Size Declaration public int Size { get; } Property Value Type Description Int32 | Improve this Doc View Source Value Header Value. Declaration public string Value { get; } Property Value Type Description String Methods | Improve this Doc View Source ToString() Returns header as a valid header string. Declaration public override string ToString() Returns Type Description String Overrides Object.ToString()" }, "api/Titanium.Web.Proxy.Models.ProxyAuthenticationContext.html": { "href": "api/Titanium.Web.Proxy.Models.ProxyAuthenticationContext.html", "title": "Class ProxyAuthenticationContext | Titanium Web Proxy", - "keywords": "Class ProxyAuthenticationContext A context container for authentication flows Inheritance Object ProxyAuthenticationContext Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Titanium.Web.Proxy.Models Assembly : Titanium.Web.Proxy.dll Syntax public class ProxyAuthenticationContext Properties | Improve this Doc View Source Continuation An optional continuation token to return to the caller if set Declaration public string Continuation { get; set; } Property Value Type Description String | Improve this Doc View Source Result The result of the current authentication request Declaration public ProxyAuthenticationResult Result { get; set; } Property Value Type Description ProxyAuthenticationResult Methods | Improve this Doc View Source Failed() Declaration public static ProxyAuthenticationContext Failed() Returns Type Description ProxyAuthenticationContext | Improve this Doc View Source Succeeded() Declaration public static ProxyAuthenticationContext Succeeded() Returns Type Description ProxyAuthenticationContext" + "keywords": "Class ProxyAuthenticationContext A context container for authentication flows Inheritance Object ProxyAuthenticationContext Inherited Members Object.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Models Assembly : Titanium.Web.Proxy.dll Syntax public class ProxyAuthenticationContext Properties | Improve this Doc View Source Continuation An optional continuation token to return to the caller if set Declaration public string Continuation { get; set; } Property Value Type Description String | Improve this Doc View Source Result The result of the current authentication request Declaration public ProxyAuthenticationResult Result { get; set; } Property Value Type Description ProxyAuthenticationResult Methods | Improve this Doc View Source Failed() Declaration public static ProxyAuthenticationContext Failed() Returns Type Description ProxyAuthenticationContext | Improve this Doc View Source Succeeded() Declaration public static ProxyAuthenticationContext Succeeded() Returns Type Description ProxyAuthenticationContext" }, "api/Titanium.Web.Proxy.Models.ProxyAuthenticationResult.html": { "href": "api/Titanium.Web.Proxy.Models.ProxyAuthenticationResult.html", @@ -247,7 +227,7 @@ "api/Titanium.Web.Proxy.Models.ProxyEndPoint.html": { "href": "api/Titanium.Web.Proxy.Models.ProxyEndPoint.html", "title": "Class ProxyEndPoint | Titanium Web Proxy", - "keywords": "Class ProxyEndPoint An abstract endpoint where the proxy listens Inheritance Object ProxyEndPoint ExplicitProxyEndPoint TransparentProxyEndPoint Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Titanium.Web.Proxy.Models Assembly : Titanium.Web.Proxy.dll Syntax public abstract class ProxyEndPoint Constructors | Improve this Doc View Source ProxyEndPoint(IPAddress, Int32, Boolean) Constructor. Declaration protected ProxyEndPoint(IPAddress ipAddress, int port, bool decryptSsl) Parameters Type Name Description IPAddress ipAddress Int32 port Boolean decryptSsl Properties | Improve this Doc View Source DecryptSsl Enable SSL? Declaration public bool DecryptSsl { get; } Property Value Type Description Boolean | Improve this Doc View Source GenericCertificate Generic certificate to use for SSL decryption. Declaration public X509Certificate2 GenericCertificate { get; set; } Property Value Type Description X509Certificate2 | Improve this Doc View Source IpAddress Ip Address we are listening. Declaration public IPAddress IpAddress { get; } Property Value Type Description IPAddress | Improve this Doc View Source Port Port we are listening. Declaration public int Port { get; } Property Value Type Description Int32" + "keywords": "Class ProxyEndPoint An abstract endpoint where the proxy listens Inheritance Object ProxyEndPoint ExplicitProxyEndPoint Inherited Members Object.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Models Assembly : Titanium.Web.Proxy.dll Syntax public abstract class ProxyEndPoint Constructors | Improve this Doc View Source ProxyEndPoint(IPAddress, Int32, Boolean) Constructor. Declaration protected ProxyEndPoint(IPAddress ipAddress, int port, bool decryptSsl) Parameters Type Name Description IPAddress ipAddress Int32 port Boolean decryptSsl Properties | Improve this Doc View Source DecryptSsl Enable SSL? Declaration public bool DecryptSsl { get; } Property Value Type Description Boolean | Improve this Doc View Source GenericCertificate Generic certificate to use for SSL decryption. Declaration public X509Certificate2 GenericCertificate { get; set; } Property Value Type Description X509Certificate2 | Improve this Doc View Source IpAddress Ip Address we are listening. Declaration public IPAddress IpAddress { get; } Property Value Type Description IPAddress | Improve this Doc View Source Port Port we are listening. Declaration public int Port { get; } Property Value Type Description Int32" }, "api/Titanium.Web.Proxy.Models.ProxyProtocolType.html": { "href": "api/Titanium.Web.Proxy.Models.ProxyProtocolType.html", @@ -257,7 +237,7 @@ "api/Titanium.Web.Proxy.Models.TransparentProxyEndPoint.html": { "href": "api/Titanium.Web.Proxy.Models.TransparentProxyEndPoint.html", "title": "Class TransparentProxyEndPoint | Titanium Web Proxy", - "keywords": "Class TransparentProxyEndPoint A proxy end point client is not aware of. Useful when requests are redirected to this proxy end point through port forwarding via router. Inheritance Object ProxyEndPoint TransparentProxyEndPoint Inherited Members ProxyEndPoint.IpAddress ProxyEndPoint.Port ProxyEndPoint.DecryptSsl ProxyEndPoint.GenericCertificate Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Titanium.Web.Proxy.Models Assembly : Titanium.Web.Proxy.dll Syntax public class TransparentProxyEndPoint : ProxyEndPoint Constructors | Improve this Doc View Source TransparentProxyEndPoint(IPAddress, Int32, Boolean) Initialize a new instance. Declaration public TransparentProxyEndPoint(IPAddress ipAddress, int port, bool decryptSsl = true) Parameters Type Name Description IPAddress ipAddress Listening Ip address. Int32 port Listening port. Boolean decryptSsl Should we decrypt ssl? Properties | Improve this Doc View Source GenericCertificateName Name of the Certificate need to be sent (same as the hostname we want to proxy). This is valid only when UseServerNameIndication is set to false. Declaration public string GenericCertificateName { get; set; } Property Value Type Description String Events | Improve this Doc View Source BeforeSslAuthenticate Before Ssl authentication this event is fired. Declaration public event AsyncEventHandler BeforeSslAuthenticate Event Type Type Description AsyncEventHandler < BeforeSslAuthenticateEventArgs >" + "keywords": "Class TransparentProxyEndPoint A proxy end point client is not aware of. Useful when requests are redirected to this proxy end point through port forwarding via router. Inheritance Object TransparentProxyEndPoint Namespace : Titanium.Web.Proxy.Models Assembly : Titanium.Web.Proxy.dll Syntax public class TransparentProxyEndPoint : TransparentBaseProxyEndPoint Constructors | Improve this Doc View Source TransparentProxyEndPoint(IPAddress, Int32, Boolean) Initialize a new instance. Declaration public TransparentProxyEndPoint(IPAddress ipAddress, int port, bool decryptSsl = true) Parameters Type Name Description IPAddress ipAddress Listening Ip address. Int32 port Listening port. Boolean decryptSsl Should we decrypt ssl? Properties | Improve this Doc View Source GenericCertificateName Name of the Certificate need to be sent (same as the hostname we want to proxy). This is valid only when UseServerNameIndication is set to false. Declaration public override string GenericCertificateName { get; set; } Property Value Type Description String Events | Improve this Doc View Source BeforeSslAuthenticate Before Ssl authentication this event is fired. Declaration public event AsyncEventHandler BeforeSslAuthenticate Event Type Type Description AsyncEventHandler < BeforeSslAuthenticateEventArgs >" }, "api/Titanium.Web.Proxy.Network.CertificateEngine.html": { "href": "api/Titanium.Web.Proxy.Network.CertificateEngine.html", @@ -267,7 +247,7 @@ "api/Titanium.Web.Proxy.Network.CertificateManager.html": { "href": "api/Titanium.Web.Proxy.Network.CertificateManager.html", "title": "Class CertificateManager | Titanium Web Proxy", - "keywords": "Class CertificateManager A class to manage SSL certificates used by this proxy server. Inheritance Object CertificateManager Implements IDisposable Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Titanium.Web.Proxy.Network Assembly : Titanium.Web.Proxy.dll Syntax public sealed class CertificateManager : IDisposable Properties | Improve this Doc View Source CertificateCacheTimeOutMinutes Minutes certificates should be kept in cache when not used. Declaration public int CertificateCacheTimeOutMinutes { get; set; } Property Value Type Description Int32 | Improve this Doc View Source CertificateEngine Select Certificate Engine. Optionally set to BouncyCastle. Mono only support BouncyCastle and it is the default. Declaration public CertificateEngine CertificateEngine { get; set; } Property Value Type Description CertificateEngine | Improve this Doc View Source CertificateStorage The fake certificate cache storage. The default cache storage implementation saves certificates in folder \"crts\" (will be created in proxy dll directory). Implement ICertificateCache interface and assign concrete class here to customize. Declaration public ICertificateCache CertificateStorage { get; set; } Property Value Type Description ICertificateCache | Improve this Doc View Source OverwritePfxFile Overwrite Root certificate file. true : replace an existing .pfx file if password is incorrect or if RootCertificate = null. Declaration public bool OverwritePfxFile { get; set; } Property Value Type Description Boolean | Improve this Doc View Source PfxFilePath Name(path) of the Root certificate file. Set the name(path) of the .pfx file. If it is string.Empty Root certificate file will be named as \"rootCert.pfx\" (and will be saved in proxy dll directory) Declaration public string PfxFilePath { get; set; } Property Value Type Description String | Improve this Doc View Source PfxPassword Password of the Root certificate file. Set a password for the .pfx file Declaration public string PfxPassword { get; set; } Property Value Type Description String | Improve this Doc View Source RootCertificate The root certificate. Declaration public X509Certificate2 RootCertificate { get; set; } Property Value Type Description X509Certificate2 | Improve this Doc View Source RootCertificateIssuerName Name of the root certificate issuer. (This is valid only when RootCertificate property is not set.) Declaration public string RootCertificateIssuerName { get; set; } Property Value Type Description String | Improve this Doc View Source RootCertificateName Name of the root certificate. (This is valid only when RootCertificate property is not set.) If no certificate is provided then a default Root Certificate will be created and used. The provided root certificate will be stored in proxy exe directory with the private key. Root certificate file will be named as \"rootCert.pfx\". Declaration public string RootCertificateName { get; set; } Property Value Type Description String | Improve this Doc View Source SaveFakeCertificates Save all fake certificates using CertificateStorage . for can load the certificate and not make new certificate every time. Declaration public bool SaveFakeCertificates { get; set; } Property Value Type Description Boolean | Improve this Doc View Source StorageFlag Adjust behaviour when certificates are saved to filesystem. Declaration public X509KeyStorageFlags StorageFlag { get; set; } Property Value Type Description X509KeyStorageFlags Methods | Improve this Doc View Source ClearRootCertificate() Clear the root certificate and cache. Declaration public void ClearRootCertificate() | Improve this Doc View Source CreateRootCertificate(Boolean) Attempts to create a RootCertificate. Declaration public bool CreateRootCertificate(bool persistToFile = true) Parameters Type Name Description Boolean persistToFile if set to true try to load/save the certificate from rootCert.pfx. Returns Type Description Boolean true if succeeded, else false. | Improve this Doc View Source CreateServerCertificate(String) Creates a server certificate signed by the root certificate. Declaration public Task CreateServerCertificate(string certificateName) Parameters Type Name Description String certificateName Returns Type Description Task < X509Certificate2 > | Improve this Doc View Source Dispose() Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Declaration public void Dispose() | Improve this Doc View Source EnsureRootCertificate() Ensure certificates are setup (creates root if required). Also makes root certificate trusted based on initial setup from proxy constructor for user/machine trust. Declaration public void EnsureRootCertificate() | Improve this Doc View Source EnsureRootCertificate(Boolean, Boolean, Boolean) Ensure certificates are setup (creates root if required). Also makes root certificate trusted based on provided parameters. Note:setting machineTrustRootCertificate to true will force userTrustRootCertificate to true. Declaration public void EnsureRootCertificate(bool userTrustRootCertificate, bool machineTrustRootCertificate, bool trustRootCertificateAsAdmin = false) Parameters Type Name Description Boolean userTrustRootCertificate Should fake HTTPS certificate be trusted by this machine's user certificate store? Boolean machineTrustRootCertificate Should fake HTTPS certificate be trusted by this machine's certificate store? Boolean trustRootCertificateAsAdmin Should we attempt to trust certificates with elevated permissions by prompting for UAC if required? | Improve this Doc View Source IsRootCertificateMachineTrusted() Determines whether the root certificate is machine trusted. Declaration public bool IsRootCertificateMachineTrusted() Returns Type Description Boolean | Improve this Doc View Source IsRootCertificateUserTrusted() Determines whether the root certificate is trusted. Declaration public bool IsRootCertificateUserTrusted() Returns Type Description Boolean | Improve this Doc View Source LoadRootCertificate() Loads root certificate from current executing assembly location with expected name rootCert.pfx. Declaration public X509Certificate2 LoadRootCertificate() Returns Type Description X509Certificate2 | Improve this Doc View Source LoadRootCertificate(String, String, Boolean, X509KeyStorageFlags) Manually load a Root certificate file from give path (.pfx file). Declaration public bool LoadRootCertificate(string pfxFilePath, string password, bool overwritePfXFile = true, X509KeyStorageFlags storageFlag = X509KeyStorageFlags.Exportable) Parameters Type Name Description String pfxFilePath Set the name(path) of the .pfx file. If it is string.Empty Root certificate file will be named as \"rootCert.pfx\" (and will be saved in proxy dll directory). String password Set a password for the .pfx file. Boolean overwritePfXFile true : replace an existing .pfx file if password is incorrect or if RootCertificate==null. X509KeyStorageFlags storageFlag Returns Type Description Boolean true if succeeded, else false. | Improve this Doc View Source RemoveTrustedRootCertificate(Boolean) Removes the trusted certificates from user store, optionally also from machine store. To remove from machine store elevated permissions are required (will fail silently otherwise). Declaration public void RemoveTrustedRootCertificate(bool machineTrusted = false) Parameters Type Name Description Boolean machineTrusted Should also remove from machine store? | Improve this Doc View Source RemoveTrustedRootCertificateAsAdmin(Boolean) Removes the trusted certificates from user store, optionally also from machine store Declaration public bool RemoveTrustedRootCertificateAsAdmin(bool machineTrusted = false) Parameters Type Name Description Boolean machineTrusted Returns Type Description Boolean Should also remove from machine store? | Improve this Doc View Source TrustRootCertificate(Boolean) Trusts the root certificate in user store, optionally also in machine store. Machine trust would require elevated permissions (will silently fail otherwise). Declaration public void TrustRootCertificate(bool machineTrusted = false) Parameters Type Name Description Boolean machineTrusted | Improve this Doc View Source TrustRootCertificateAsAdmin(Boolean) Puts the certificate to the user store, optionally also to machine store. Prompts with UAC if elevated permissions are required. Works only on Windows. Declaration public bool TrustRootCertificateAsAdmin(bool machineTrusted = false) Parameters Type Name Description Boolean machineTrusted Returns Type Description Boolean True if success. Implements System.IDisposable" + "keywords": "Class CertificateManager A class to manage SSL certificates used by this proxy server. Inheritance Object CertificateManager Implements IDisposable Inherited Members Object.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Network Assembly : Titanium.Web.Proxy.dll Syntax public sealed class CertificateManager : IDisposable Properties | Improve this Doc View Source CertificateCacheTimeOutMinutes Minutes certificates should be kept in cache when not used. Declaration public int CertificateCacheTimeOutMinutes { get; set; } Property Value Type Description Int32 | Improve this Doc View Source CertificateEngine Select Certificate Engine. Optionally set to BouncyCastle. Mono only support BouncyCastle and it is the default. Declaration public CertificateEngine CertificateEngine { get; set; } Property Value Type Description CertificateEngine | Improve this Doc View Source CertificateStorage The fake certificate cache storage. The default cache storage implementation saves certificates in folder \"crts\" (will be created in proxy dll directory). Implement ICertificateCache interface and assign concrete class here to customize. Declaration public ICertificateCache CertificateStorage { get; set; } Property Value Type Description ICertificateCache | Improve this Doc View Source OverwritePfxFile Overwrite Root certificate file. true : replace an existing .pfx file if password is incorrect or if RootCertificate = null. Declaration public bool OverwritePfxFile { get; set; } Property Value Type Description Boolean | Improve this Doc View Source PfxFilePath Name(path) of the Root certificate file. Set the name(path) of the .pfx file. If it is string.Empty Root certificate file will be named as \"rootCert.pfx\" (and will be saved in proxy dll directory) Declaration public string PfxFilePath { get; set; } Property Value Type Description String | Improve this Doc View Source PfxPassword Password of the Root certificate file. Set a password for the .pfx file Declaration public string PfxPassword { get; set; } Property Value Type Description String | Improve this Doc View Source RootCertificate The root certificate. Declaration public X509Certificate2 RootCertificate { get; set; } Property Value Type Description X509Certificate2 | Improve this Doc View Source RootCertificateIssuerName Name of the root certificate issuer. (This is valid only when RootCertificate property is not set.) Declaration public string RootCertificateIssuerName { get; set; } Property Value Type Description String | Improve this Doc View Source RootCertificateName Name of the root certificate. (This is valid only when RootCertificate property is not set.) If no certificate is provided then a default Root Certificate will be created and used. The provided root certificate will be stored in proxy exe directory with the private key. Root certificate file will be named as \"rootCert.pfx\". Declaration public string RootCertificateName { get; set; } Property Value Type Description String | Improve this Doc View Source SaveFakeCertificates Save all fake certificates using CertificateStorage . for can load the certificate and not make new certificate every time. Declaration public bool SaveFakeCertificates { get; set; } Property Value Type Description Boolean | Improve this Doc View Source StorageFlag Adjust behaviour when certificates are saved to filesystem. Declaration public X509KeyStorageFlags StorageFlag { get; set; } Property Value Type Description X509KeyStorageFlags Methods | Improve this Doc View Source ClearRootCertificate() Clear the root certificate and cache. Declaration public void ClearRootCertificate() | Improve this Doc View Source CreateRootCertificate(Boolean) Attempts to create a RootCertificate. Declaration public bool CreateRootCertificate(bool persistToFile = true) Parameters Type Name Description Boolean persistToFile if set to true try to load/save the certificate from rootCert.pfx. Returns Type Description Boolean true if succeeded, else false. | Improve this Doc View Source CreateServerCertificate(String) Creates a server certificate signed by the root certificate. Declaration public Task CreateServerCertificate(string certificateName) Parameters Type Name Description String certificateName Returns Type Description Task < X509Certificate2 > | Improve this Doc View Source Dispose() Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Declaration public void Dispose() | Improve this Doc View Source EnsureRootCertificate() Ensure certificates are setup (creates root if required). Also makes root certificate trusted based on initial setup from proxy constructor for user/machine trust. Declaration public void EnsureRootCertificate() | Improve this Doc View Source EnsureRootCertificate(Boolean, Boolean, Boolean) Ensure certificates are setup (creates root if required). Also makes root certificate trusted based on provided parameters. Note:setting machineTrustRootCertificate to true will force userTrustRootCertificate to true. Declaration public void EnsureRootCertificate(bool userTrustRootCertificate, bool machineTrustRootCertificate, bool trustRootCertificateAsAdmin = false) Parameters Type Name Description Boolean userTrustRootCertificate Should fake HTTPS certificate be trusted by this machine's user certificate store? Boolean machineTrustRootCertificate Should fake HTTPS certificate be trusted by this machine's certificate store? Boolean trustRootCertificateAsAdmin Should we attempt to trust certificates with elevated permissions by prompting for UAC if required? | Improve this Doc View Source IsRootCertificateMachineTrusted() Determines whether the root certificate is machine trusted. Declaration public bool IsRootCertificateMachineTrusted() Returns Type Description Boolean | Improve this Doc View Source IsRootCertificateUserTrusted() Determines whether the root certificate is trusted. Declaration public bool IsRootCertificateUserTrusted() Returns Type Description Boolean | Improve this Doc View Source LoadRootCertificate() Loads root certificate from current executing assembly location with expected name rootCert.pfx. Declaration public X509Certificate2 LoadRootCertificate() Returns Type Description X509Certificate2 | Improve this Doc View Source LoadRootCertificate(String, String, Boolean, X509KeyStorageFlags) Manually load a Root certificate file from give path (.pfx file). Declaration public bool LoadRootCertificate(string pfxFilePath, string password, bool overwritePfXFile = true, X509KeyStorageFlags storageFlag = X509KeyStorageFlags.Exportable) Parameters Type Name Description String pfxFilePath Set the name(path) of the .pfx file. If it is string.Empty Root certificate file will be named as \"rootCert.pfx\" (and will be saved in proxy dll directory). String password Set a password for the .pfx file. Boolean overwritePfXFile true : replace an existing .pfx file if password is incorrect or if RootCertificate==null. X509KeyStorageFlags storageFlag Returns Type Description Boolean true if succeeded, else false. | Improve this Doc View Source RemoveTrustedRootCertificate(Boolean) Removes the trusted certificates from user store, optionally also from machine store. To remove from machine store elevated permissions are required (will fail silently otherwise). Declaration public void RemoveTrustedRootCertificate(bool machineTrusted = false) Parameters Type Name Description Boolean machineTrusted Should also remove from machine store? | Improve this Doc View Source RemoveTrustedRootCertificateAsAdmin(Boolean) Removes the trusted certificates from user store, optionally also from machine store Declaration public bool RemoveTrustedRootCertificateAsAdmin(bool machineTrusted = false) Parameters Type Name Description Boolean machineTrusted Returns Type Description Boolean Should also remove from machine store? | Improve this Doc View Source TrustRootCertificate(Boolean) Trusts the root certificate in user store, optionally also in machine store. Machine trust would require elevated permissions (will silently fail otherwise). Declaration public void TrustRootCertificate(bool machineTrusted = false) Parameters Type Name Description Boolean machineTrusted | Improve this Doc View Source TrustRootCertificateAsAdmin(Boolean) Puts the certificate to the user store, optionally also to machine store. Prompts with UAC if elevated permissions are required. Works only on Windows. Declaration public bool TrustRootCertificateAsAdmin(bool machineTrusted = false) Parameters Type Name Description Boolean machineTrusted Returns Type Description Boolean True if success. Implements System.IDisposable" }, "api/Titanium.Web.Proxy.Network.html": { "href": "api/Titanium.Web.Proxy.Network.html", @@ -277,6 +257,6 @@ "api/Titanium.Web.Proxy.ProxyServer.html": { "href": "api/Titanium.Web.Proxy.ProxyServer.html", "title": "Class ProxyServer | Titanium Web Proxy", - "keywords": "Class ProxyServer This class 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. Inheritance Object ProxyServer Implements IDisposable Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Titanium.Web.Proxy Assembly : Titanium.Web.Proxy.dll Syntax public class ProxyServer : IDisposable Constructors | Improve this Doc View Source ProxyServer(Boolean, Boolean, Boolean) Initializes a new instance of ProxyServer class with provided parameters. Declaration public ProxyServer(bool userTrustRootCertificate = true, bool machineTrustRootCertificate = false, bool trustRootCertificateAsAdmin = false) Parameters Type Name Description Boolean userTrustRootCertificate Should fake HTTPS certificate be trusted by this machine's user certificate store? Boolean machineTrustRootCertificate Should fake HTTPS certificate be trusted by this machine's certificate store? Boolean trustRootCertificateAsAdmin Should we attempt to trust certificates with elevated permissions by prompting for UAC if required? | Improve this Doc View Source ProxyServer(String, String, Boolean, Boolean, Boolean) Initializes a new instance of ProxyServer class with provided parameters. Declaration public ProxyServer(string rootCertificateName, string rootCertificateIssuerName, bool userTrustRootCertificate = true, bool machineTrustRootCertificate = false, bool trustRootCertificateAsAdmin = false) Parameters Type Name Description String rootCertificateName Name of the root certificate. String rootCertificateIssuerName Name of the root certificate issuer. Boolean userTrustRootCertificate Should fake HTTPS certificate be trusted by this machine's user certificate store? Boolean machineTrustRootCertificate Should fake HTTPS certificate be trusted by this machine's certificate store? Boolean trustRootCertificateAsAdmin Should we attempt to trust certificates with elevated permissions by prompting for UAC if required? Properties | Improve this Doc View Source BufferPool The buffer pool used throughout this proxy instance. Set custom implementations by implementing this interface. By default this uses DefaultBufferPool implementation available in StreamExtended library package. Declaration public IBufferPool BufferPool { get; set; } Property Value Type Description IBufferPool | Improve this Doc View Source CertificateManager Manages certificates used by this proxy. Declaration public CertificateManager CertificateManager { get; } Property Value Type Description CertificateManager | Improve this Doc View Source CheckCertificateRevocation Should we check for certificate revocation during SSL authentication to servers Note: If enabled can reduce performance. Defaults to false. Declaration public X509RevocationMode CheckCertificateRevocation { get; set; } Property Value Type Description X509RevocationMode | Improve this Doc View Source ClientConnectionCount Total number of active client connections. Declaration public int ClientConnectionCount { get; } Property Value Type Description Int32 | Improve this Doc View Source ConnectionTimeOutSeconds Seconds client/server connection are to be kept alive when waiting for read/write to complete. This will also determine the pool eviction time when connection pool is enabled. Default value is 60 seconds. Declaration public int ConnectionTimeOutSeconds { get; set; } Property Value Type Description Int32 | Improve this Doc View Source Enable100ContinueBehaviour Does this proxy uses the HTTP protocol 100 continue behaviour strictly? Broken 100 continue implementations on server/client may cause problems if enabled. Defaults to false. Declaration public bool Enable100ContinueBehaviour { get; set; } Property Value Type Description Boolean | Improve this Doc View Source EnableConnectionPool Should we enable experimental server connection pool? Defaults to true. Declaration public bool EnableConnectionPool { get; set; } Property Value Type Description Boolean | Improve this Doc View Source EnableHttp2 Enable disable HTTP/2 support. Warning: HTTP/2 support is very limited only enabled when both client and server supports it (no protocol changing in proxy) cannot modify the request/response (e.g header modifications in BeforeRequest/Response events are ignored) Declaration public bool EnableHttp2 { get; set; } Property Value Type Description Boolean | Improve this Doc View Source EnableTcpServerConnectionPrefetch Should we enable tcp server connection prefetching? When enabled, as soon as we receive a client connection we concurrently initiate corresponding server connection process using CONNECT hostname or SNI hostname on a separate task so that after parsing client request we will have the server connection immediately ready or in the process of getting ready. If a server connection is available in cache then this prefetch task will immediately return with the available connection from cache. Defaults to true. Declaration public bool EnableTcpServerConnectionPrefetch { get; set; } Property Value Type Description Boolean | Improve this Doc View Source EnableWinAuth Enable disable Windows Authentication (NTLM/Kerberos). Note: NTLM/Kerberos will always send local credentials of current user running the proxy process. This is because a man in middle attack with Windows domain authentication is not currently supported. Defaults to false. Declaration public bool EnableWinAuth { get; set; } Property Value Type Description Boolean | Improve this Doc View Source ExceptionFunc Callback for error events in this proxy instance. Declaration public ExceptionHandler ExceptionFunc { get; set; } Property Value Type Description ExceptionHandler | Improve this Doc View Source ForwardToUpstreamGateway Gets or sets a value indicating whether requests will be chained to upstream gateway. Defaults to false. Declaration public bool ForwardToUpstreamGateway { get; set; } Property Value Type Description Boolean | Improve this Doc View Source GetCustomUpStreamProxyFunc 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. Declaration public Func> GetCustomUpStreamProxyFunc { get; set; } Property Value Type Description Func < SessionEventArgsBase , Task < ExternalProxy >> | Improve this Doc View Source MaxCachedConnections Maximum number of concurrent connections per remote host in cache. Only valid when connection pooling is enabled. Default value is 2. Declaration public int MaxCachedConnections { get; set; } Property Value Type Description Int32 | Improve this Doc View Source NoDelay Gets or sets a Boolean value that specifies whether server and client stream Sockets are using the Nagle algorithm. Defaults to true, no nagle algorithm is used. Declaration public bool NoDelay { get; set; } Property Value Type Description Boolean | Improve this Doc View Source ProxyAuthenticationRealm Realm used during Proxy Basic Authentication. Declaration public string ProxyAuthenticationRealm { get; set; } Property Value Type Description String | Improve this Doc View Source ProxyAuthenticationSchemes A collection of scheme types, e.g. basic, NTLM, Kerberos, Negotiate, to return if scheme authentication is required. Works in relation with ProxySchemeAuthenticateFunc. Declaration public IEnumerable ProxyAuthenticationSchemes { get; set; } Property Value Type Description IEnumerable < String > | Improve this Doc View Source ProxyBasicAuthenticateFunc A callback to authenticate proxy clients via basic authentication. Parameters are username and password as provided by client. Should return true for successful authentication. Declaration public Func> ProxyBasicAuthenticateFunc { get; set; } Property Value Type Description Func < SessionEventArgsBase , String , String , Task < Boolean >> | Improve this Doc View Source ProxyEndPoints A list of IpAddress and port this proxy is listening to. Declaration public List ProxyEndPoints { get; set; } Property Value Type Description List < ProxyEndPoint > | Improve this Doc View Source ProxyRunning Is the proxy currently running? Declaration public bool ProxyRunning { get; } Property Value Type Description Boolean | Improve this Doc View Source ProxySchemeAuthenticateFunc A pluggable callback to authenticate clients by scheme instead of requiring basic authentication through ProxyBasicAuthenticateFunc. Parameters are current working session, schemeType, and token as provided by a calling client. Should return success for successful authentication, continuation if the package requests, or failure. Declaration public Func> ProxySchemeAuthenticateFunc { get; set; } Property Value Type Description Func < SessionEventArgsBase , String , String , Task < ProxyAuthenticationContext >> | Improve this Doc View Source ReuseSocket Should we reuse client/server tcp sockets. Default is true (disabled for linux/macOS due to bug in .Net core). Declaration public bool ReuseSocket { get; set; } Property Value Type Description Boolean | Improve this Doc View Source ServerConnectionCount Total number of active server connections. Declaration public int ServerConnectionCount { get; } Property Value Type Description Int32 | Improve this Doc View Source SupportedSslProtocols List of supported Ssl versions. Declaration public SslProtocols SupportedSslProtocols { get; set; } Property Value Type Description SslProtocols | Improve this Doc View Source TcpTimeWaitSeconds Number of seconds to linger when Tcp connection is in TIME_WAIT state. Default value is 30. Declaration public int TcpTimeWaitSeconds { get; set; } Property Value Type Description Int32 | Improve this Doc View Source ThreadPoolWorkerThread Customize the minimum ThreadPool size (increase it on a server) Declaration public int ThreadPoolWorkerThread { get; set; } Property Value Type Description Int32 | Improve this Doc View Source UpStreamEndPoint Local adapter/NIC endpoint where proxy makes request via. Defaults via any IP addresses of this machine. Declaration public IPEndPoint UpStreamEndPoint { get; set; } Property Value Type Description IPEndPoint | Improve this Doc View Source UpStreamHttpProxy External proxy used for Http requests. Declaration public ExternalProxy UpStreamHttpProxy { get; set; } Property Value Type Description ExternalProxy | Improve this Doc View Source UpStreamHttpsProxy External proxy used for Https requests. Declaration public ExternalProxy UpStreamHttpsProxy { get; set; } Property Value Type Description ExternalProxy Methods | Improve this Doc View Source AddEndPoint(ProxyEndPoint) Add a proxy end point. Declaration public void AddEndPoint(ProxyEndPoint endPoint) Parameters Type Name Description ProxyEndPoint endPoint The proxy endpoint. | Improve this Doc View Source DisableAllSystemProxies() Clear all proxy settings for current machine. Declaration public void DisableAllSystemProxies() | Improve this Doc View Source DisableSystemHttpProxy() Clear HTTP proxy settings of current machine. Declaration public void DisableSystemHttpProxy() | Improve this Doc View Source DisableSystemHttpsProxy() Clear HTTPS proxy settings of current machine. Declaration public void DisableSystemHttpsProxy() | Improve this Doc View Source DisableSystemProxy(ProxyProtocolType) Clear the specified proxy setting for current machine. Declaration public void DisableSystemProxy(ProxyProtocolType protocolType) Parameters Type Name Description ProxyProtocolType protocolType | Improve this Doc View Source Dispose() Dispose the Proxy instance. Declaration public void Dispose() | Improve this Doc View Source RemoveEndPoint(ProxyEndPoint) Remove a proxy end point. Will throw error if the end point doesn't exist. Declaration public void RemoveEndPoint(ProxyEndPoint endPoint) Parameters Type Name Description ProxyEndPoint endPoint The existing endpoint to remove. | Improve this Doc View Source RestoreOriginalProxySettings() Restores the original proxy settings. Declaration public void RestoreOriginalProxySettings() | Improve this Doc View Source SetAsSystemHttpProxy(ExplicitProxyEndPoint) Set the given explicit end point as the default proxy server for current machine. Declaration public void SetAsSystemHttpProxy(ExplicitProxyEndPoint endPoint) Parameters Type Name Description ExplicitProxyEndPoint endPoint The explicit endpoint. | Improve this Doc View Source SetAsSystemHttpsProxy(ExplicitProxyEndPoint) Set the given explicit end point as the default proxy server for current machine. Declaration public void SetAsSystemHttpsProxy(ExplicitProxyEndPoint endPoint) Parameters Type Name Description ExplicitProxyEndPoint endPoint The explicit endpoint. | Improve this Doc View Source SetAsSystemProxy(ExplicitProxyEndPoint, ProxyProtocolType) Set the given explicit end point as the default proxy server for current machine. Declaration public void SetAsSystemProxy(ExplicitProxyEndPoint endPoint, ProxyProtocolType protocolType) Parameters Type Name Description ExplicitProxyEndPoint endPoint The explicit endpoint. ProxyProtocolType protocolType The proxy protocol type. | Improve this Doc View Source Start() Start this proxy server instance. Declaration public void Start() | Improve this Doc View Source Stop() Stop this proxy server instance. Declaration public void Stop() Events | Improve this Doc View Source AfterResponse Intercept after response event from server. Declaration public event AsyncEventHandler AfterResponse Event Type Type Description AsyncEventHandler < SessionEventArgs > | Improve this Doc View Source BeforeRequest Intercept request event to server. Declaration public event AsyncEventHandler BeforeRequest Event Type Type Description AsyncEventHandler < SessionEventArgs > | Improve this Doc View Source BeforeResponse Intercept response event from server. Declaration public event AsyncEventHandler BeforeResponse Event Type Type Description AsyncEventHandler < SessionEventArgs > | Improve this Doc View Source ClientCertificateSelectionCallback Event to override client certificate selection during mutual SSL authentication. Declaration public event AsyncEventHandler ClientCertificateSelectionCallback Event Type Type Description AsyncEventHandler < CertificateSelectionEventArgs > | Improve this Doc View Source ClientConnectionCountChanged Event occurs when client connection count changed. Declaration public event EventHandler ClientConnectionCountChanged Event Type Type Description EventHandler | Improve this Doc View Source OnClientConnectionCreate Customize TcpClient used for client connection upon create. Declaration public event AsyncEventHandler OnClientConnectionCreate Event Type Type Description AsyncEventHandler < TcpClient > | Improve this Doc View Source OnServerConnectionCreate Customize TcpClient used for server connection upon create. Declaration public event AsyncEventHandler OnServerConnectionCreate Event Type Type Description AsyncEventHandler < TcpClient > | Improve this Doc View Source ServerCertificateValidationCallback Event to override the default verification logic of remote SSL certificate received during authentication. Declaration public event AsyncEventHandler ServerCertificateValidationCallback Event Type Type Description AsyncEventHandler < CertificateValidationEventArgs > | Improve this Doc View Source ServerConnectionCountChanged Event occurs when server connection count changed. Declaration public event EventHandler ServerConnectionCountChanged Event Type Type Description EventHandler Implements System.IDisposable" + "keywords": "Class ProxyServer This class 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. Inheritance Object ProxyServer Implements IDisposable Inherited Members Object.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy Assembly : Titanium.Web.Proxy.dll Syntax public class ProxyServer : IDisposable Constructors | Improve this Doc View Source ProxyServer(Boolean, Boolean, Boolean) Initializes a new instance of ProxyServer class with provided parameters. Declaration public ProxyServer(bool userTrustRootCertificate = true, bool machineTrustRootCertificate = false, bool trustRootCertificateAsAdmin = false) Parameters Type Name Description Boolean userTrustRootCertificate Should fake HTTPS certificate be trusted by this machine's user certificate store? Boolean machineTrustRootCertificate Should fake HTTPS certificate be trusted by this machine's certificate store? Boolean trustRootCertificateAsAdmin Should we attempt to trust certificates with elevated permissions by prompting for UAC if required? | Improve this Doc View Source ProxyServer(String, String, Boolean, Boolean, Boolean) Initializes a new instance of ProxyServer class with provided parameters. Declaration public ProxyServer(string rootCertificateName, string rootCertificateIssuerName, bool userTrustRootCertificate = true, bool machineTrustRootCertificate = false, bool trustRootCertificateAsAdmin = false) Parameters Type Name Description String rootCertificateName Name of the root certificate. String rootCertificateIssuerName Name of the root certificate issuer. Boolean userTrustRootCertificate Should fake HTTPS certificate be trusted by this machine's user certificate store? Boolean machineTrustRootCertificate Should fake HTTPS certificate be trusted by this machine's certificate store? Boolean trustRootCertificateAsAdmin Should we attempt to trust certificates with elevated permissions by prompting for UAC if required? Properties | Improve this Doc View Source BufferPool The buffer pool used throughout this proxy instance. Set custom implementations by implementing this interface. By default this uses DefaultBufferPool implementation available in StreamExtended library package. Buffer size should be at least 10 bytes. Declaration public IBufferPool BufferPool { get; set; } Property Value Type Description IBufferPool | Improve this Doc View Source CertificateManager Manages certificates used by this proxy. Declaration public CertificateManager CertificateManager { get; } Property Value Type Description CertificateManager | Improve this Doc View Source CheckCertificateRevocation Should we check for certificate revocation during SSL authentication to servers Note: If enabled can reduce performance. Defaults to false. Declaration public X509RevocationMode CheckCertificateRevocation { get; set; } Property Value Type Description X509RevocationMode | Improve this Doc View Source ClientConnectionCount Total number of active client connections. Declaration public int ClientConnectionCount { get; } Property Value Type Description Int32 | Improve this Doc View Source ConnectionTimeOutSeconds Seconds client/server connection are to be kept alive when waiting for read/write to complete. This will also determine the pool eviction time when connection pool is enabled. Default value is 60 seconds. Declaration public int ConnectionTimeOutSeconds { get; set; } Property Value Type Description Int32 | Improve this Doc View Source ConnectTimeOutSeconds Seconds server connection are to wait for connection to be established. Default value is 20 seconds. Declaration public int ConnectTimeOutSeconds { get; set; } Property Value Type Description Int32 | Improve this Doc View Source CustomUpStreamProxyFailureFunc A callback to provide a chance for an upstream proxy failure to be handled by a new upstream proxy. User should return the ExternalProxy object with valid credentials or null. Declaration public Func> CustomUpStreamProxyFailureFunc { get; set; } Property Value Type Description Func < SessionEventArgsBase , Task < Nullable < IExternalProxy >>> | Improve this Doc View Source Enable100ContinueBehaviour Does this proxy uses the HTTP protocol 100 continue behaviour strictly? Broken 100 continue implementations on server/client may cause problems if enabled. Defaults to false. Declaration public bool Enable100ContinueBehaviour { get; set; } Property Value Type Description Boolean | Improve this Doc View Source EnableConnectionPool Should we enable experimental server connection pool? Defaults to true. Declaration public bool EnableConnectionPool { get; set; } Property Value Type Description Boolean | Improve this Doc View Source EnableHttp2 Enable disable HTTP/2 support. Warning: HTTP/2 support is very limited only enabled when both client and server supports it (no protocol changing in proxy) cannot modify the request/response (e.g header modifications in BeforeRequest/Response events are ignored) Declaration public bool EnableHttp2 { get; set; } Property Value Type Description Boolean | Improve this Doc View Source EnableTcpServerConnectionPrefetch Should we enable tcp server connection prefetching? When enabled, as soon as we receive a client connection we concurrently initiate corresponding server connection process using CONNECT hostname or SNI hostname on a separate task so that after parsing client request we will have the server connection immediately ready or in the process of getting ready. If a server connection is available in cache then this prefetch task will immediately return with the available connection from cache. Defaults to true. Declaration public bool EnableTcpServerConnectionPrefetch { get; set; } Property Value Type Description Boolean | Improve this Doc View Source EnableWinAuth Enable disable Windows Authentication (NTLM/Kerberos). Note: NTLM/Kerberos will always send local credentials of current user running the proxy process. This is because a man in middle attack with Windows domain authentication is not currently supported. Defaults to false. Declaration public bool EnableWinAuth { get; set; } Property Value Type Description Boolean | Improve this Doc View Source ExceptionFunc Callback for error events in this proxy instance. Declaration public ExceptionHandler ExceptionFunc { get; set; } Property Value Type Description ExceptionHandler | Improve this Doc View Source ForwardToUpstreamGateway Gets or sets a value indicating whether requests will be chained to upstream gateway. Defaults to false. Declaration public bool ForwardToUpstreamGateway { get; set; } Property Value Type Description Boolean | Improve this Doc View Source GetCustomUpStreamProxyFunc 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. Declaration public Func> GetCustomUpStreamProxyFunc { get; set; } Property Value Type Description Func < SessionEventArgsBase , Task < Nullable < IExternalProxy >>> | Improve this Doc View Source MaxCachedConnections Maximum number of concurrent connections per remote host in cache. Only valid when connection pooling is enabled. Default value is 2. Declaration public int MaxCachedConnections { get; set; } Property Value Type Description Int32 | Improve this Doc View Source NoDelay Gets or sets a Boolean value that specifies whether server and client stream Sockets are using the Nagle algorithm. Defaults to true, no nagle algorithm is used. Declaration public bool NoDelay { get; set; } Property Value Type Description Boolean | Improve this Doc View Source ProxyAuthenticationRealm Realm used during Proxy Basic Authentication. Declaration public string ProxyAuthenticationRealm { get; set; } Property Value Type Description String | Improve this Doc View Source ProxyAuthenticationSchemes A collection of scheme types, e.g. basic, NTLM, Kerberos, Negotiate, to return if scheme authentication is required. Works in relation with ProxySchemeAuthenticateFunc. Declaration public IEnumerable ProxyAuthenticationSchemes { get; set; } Property Value Type Description IEnumerable < String > | Improve this Doc View Source ProxyBasicAuthenticateFunc A callback to authenticate proxy clients via basic authentication. Parameters are username and password as provided by client. Should return true for successful authentication. Declaration public Func> ProxyBasicAuthenticateFunc { get; set; } Property Value Type Description Func < SessionEventArgsBase , String , String , Task < Boolean >> | Improve this Doc View Source ProxyEndPoints A list of IpAddress and port this proxy is listening to. Declaration public List ProxyEndPoints { get; set; } Property Value Type Description List < ProxyEndPoint > | Improve this Doc View Source ProxyRunning Is the proxy currently running? Declaration public bool ProxyRunning { get; } Property Value Type Description Boolean | Improve this Doc View Source ProxySchemeAuthenticateFunc A pluggable callback to authenticate clients by scheme instead of requiring basic authentication through ProxyBasicAuthenticateFunc. Parameters are current working session, schemeType, and token as provided by a calling client. Should return success for successful authentication, continuation if the package requests, or failure. Declaration public Func> ProxySchemeAuthenticateFunc { get; set; } Property Value Type Description Func < SessionEventArgsBase , String , String , Task < ProxyAuthenticationContext >> | Improve this Doc View Source ReuseSocket Should we reuse client/server tcp sockets. Default is true (disabled for linux/macOS due to bug in .Net core). Declaration public bool ReuseSocket { get; set; } Property Value Type Description Boolean | Improve this Doc View Source ServerConnectionCount Total number of active server connections. Declaration public int ServerConnectionCount { get; } Property Value Type Description Int32 | Improve this Doc View Source SupportedSslProtocols List of supported Ssl versions. Declaration public SslProtocols SupportedSslProtocols { get; set; } Property Value Type Description SslProtocols | Improve this Doc View Source TcpTimeWaitSeconds Number of seconds to linger when Tcp connection is in TIME_WAIT state. Default value is 30. Declaration public int TcpTimeWaitSeconds { get; set; } Property Value Type Description Int32 | Improve this Doc View Source ThreadPoolWorkerThread Customize the minimum ThreadPool size (increase it on a server) Declaration public int ThreadPoolWorkerThread { get; set; } Property Value Type Description Int32 | Improve this Doc View Source UpStreamEndPoint Local adapter/NIC endpoint where proxy makes request via. Defaults via any IP addresses of this machine. Declaration public IPEndPoint UpStreamEndPoint { get; set; } Property Value Type Description IPEndPoint | Improve this Doc View Source UpStreamHttpProxy External proxy used for Http requests. Declaration public IExternalProxy? UpStreamHttpProxy { get; set; } Property Value Type Description Nullable < IExternalProxy > | Improve this Doc View Source UpStreamHttpsProxy External proxy used for Https requests. Declaration public IExternalProxy? UpStreamHttpsProxy { get; set; } Property Value Type Description Nullable < IExternalProxy > Methods | Improve this Doc View Source AddEndPoint(ProxyEndPoint) Add a proxy end point. Declaration public void AddEndPoint(ProxyEndPoint endPoint) Parameters Type Name Description ProxyEndPoint endPoint The proxy endpoint. | Improve this Doc View Source DisableAllSystemProxies() Clear all proxy settings for current machine. Declaration public void DisableAllSystemProxies() | Improve this Doc View Source DisableSystemHttpProxy() Clear HTTP proxy settings of current machine. Declaration public void DisableSystemHttpProxy() | Improve this Doc View Source DisableSystemHttpsProxy() Clear HTTPS proxy settings of current machine. Declaration public void DisableSystemHttpsProxy() | Improve this Doc View Source DisableSystemProxy(ProxyProtocolType) Clear the specified proxy setting for current machine. Declaration public void DisableSystemProxy(ProxyProtocolType protocolType) Parameters Type Name Description ProxyProtocolType protocolType | Improve this Doc View Source Dispose() Dispose the Proxy instance. Declaration public void Dispose() | Improve this Doc View Source RemoveEndPoint(ProxyEndPoint) Remove a proxy end point. Will throw error if the end point doesn't exist. Declaration public void RemoveEndPoint(ProxyEndPoint endPoint) Parameters Type Name Description ProxyEndPoint endPoint The existing endpoint to remove. | Improve this Doc View Source RestoreOriginalProxySettings() Restores the original proxy settings. Declaration public void RestoreOriginalProxySettings() | Improve this Doc View Source SetAsSystemHttpProxy(ExplicitProxyEndPoint) Set the given explicit end point as the default proxy server for current machine. Declaration public void SetAsSystemHttpProxy(ExplicitProxyEndPoint endPoint) Parameters Type Name Description ExplicitProxyEndPoint endPoint The explicit endpoint. | Improve this Doc View Source SetAsSystemHttpsProxy(ExplicitProxyEndPoint) Set the given explicit end point as the default proxy server for current machine. Declaration public void SetAsSystemHttpsProxy(ExplicitProxyEndPoint endPoint) Parameters Type Name Description ExplicitProxyEndPoint endPoint The explicit endpoint. | Improve this Doc View Source SetAsSystemProxy(ExplicitProxyEndPoint, ProxyProtocolType) Set the given explicit end point as the default proxy server for current machine. Declaration public void SetAsSystemProxy(ExplicitProxyEndPoint endPoint, ProxyProtocolType protocolType) Parameters Type Name Description ExplicitProxyEndPoint endPoint The explicit endpoint. ProxyProtocolType protocolType The proxy protocol type. | Improve this Doc View Source Start() Start this proxy server instance. Declaration public void Start() | Improve this Doc View Source Stop() Stop this proxy server instance. Declaration public void Stop() Events | Improve this Doc View Source AfterResponse Intercept after response event from server. Declaration public event AsyncEventHandler AfterResponse Event Type Type Description AsyncEventHandler < SessionEventArgs > | Improve this Doc View Source BeforeRequest Intercept request event to server. Declaration public event AsyncEventHandler BeforeRequest Event Type Type Description AsyncEventHandler < SessionEventArgs > | Improve this Doc View Source BeforeResponse Intercept response event from server. Declaration public event AsyncEventHandler BeforeResponse Event Type Type Description AsyncEventHandler < SessionEventArgs > | Improve this Doc View Source ClientCertificateSelectionCallback Event to override client certificate selection during mutual SSL authentication. Declaration public event AsyncEventHandler ClientCertificateSelectionCallback Event Type Type Description AsyncEventHandler < CertificateSelectionEventArgs > | Improve this Doc View Source ClientConnectionCountChanged Event occurs when client connection count changed. Declaration public event EventHandler ClientConnectionCountChanged Event Type Type Description EventHandler | Improve this Doc View Source OnClientConnectionCreate Customize TcpClient used for client connection upon create. Declaration public event AsyncEventHandler OnClientConnectionCreate Event Type Type Description AsyncEventHandler < Socket > | Improve this Doc View Source OnServerConnectionCreate Customize TcpClient used for server connection upon create. Declaration public event AsyncEventHandler OnServerConnectionCreate Event Type Type Description AsyncEventHandler < Socket > | Improve this Doc View Source ServerCertificateValidationCallback Event to override the default verification logic of remote SSL certificate received during authentication. Declaration public event AsyncEventHandler ServerCertificateValidationCallback Event Type Type Description AsyncEventHandler < CertificateValidationEventArgs > | Improve this Doc View Source ServerConnectionCountChanged Event occurs when server connection count changed. Declaration public event EventHandler ServerConnectionCountChanged Event Type Type Description EventHandler Implements System.IDisposable" } } diff --git a/docs/styles/docfx.css b/docs/styles/docfx.css index c31a00da8..dc00b0403 100644 --- a/docs/styles/docfx.css +++ b/docs/styles/docfx.css @@ -562,6 +562,7 @@ body .toc{ border: 0; color: #666666; padding-left: 20px; + padding-right: 20px; width: 100%; } .toc-filter > input:focus { @@ -572,6 +573,11 @@ body .toc{ top: 10px; left: 5px; } +.toc-filter > .clear-icon { + position: absolute; + top: 10px; + right: 5px; +} .article { margin-top: 120px; margin-bottom: 115px; @@ -632,7 +638,6 @@ body .toc{ overflow: hidden; padding-bottom: 10px; height: calc(100% - 100px); - margin-right: -20px; } .affix ul > li > a:before { color: #cccccc; diff --git a/docs/styles/docfx.js b/docs/styles/docfx.js index 54765fa40..384396b3d 100644 --- a/docs/styles/docfx.js +++ b/docs/styles/docfx.js @@ -347,6 +347,14 @@ $(function () { } else { $('#navbar ul a.active').parents('li').addClass(active); renderBreadcrumb(); + showSearch(); + } + + function showSearch() { + if ($('#search-results').length !== 0) { + $('#search').show(); + $('body').trigger("searchEvent"); + } } function loadNavbar() { @@ -359,10 +367,7 @@ $(function () { if (tocPath) tocPath = tocPath.replace(/\\/g, '/'); $.get(navbarPath, function (data) { $(data).find("#toc>ul").appendTo("#navbar"); - if ($('#search-results').length !== 0) { - $('#search').show(); - $('body').trigger("searchEvent"); - } + showSearch(); var index = navbarPath.lastIndexOf('/'); var navrel = ''; if (index > -1) { @@ -377,7 +382,6 @@ $(function () { href = navrel + href; $(e).attr("href", href); - // TODO: currently only support one level navbar var isActive = false; var originalHref = e.name; if (originalHref) { @@ -430,20 +434,29 @@ $(function () { } function registerTocEvents() { + var tocFilterInput = $('#toc_filter_input'); + var tocFilterClearButton = $('#toc_filter_clear'); + $('.toc .nav > li > .expand-stub').click(function (e) { $(e.target).parent().toggleClass(expanded); }); $('.toc .nav > li > .expand-stub + a:not([href])').click(function (e) { $(e.target).parent().toggleClass(expanded); }); - $('#toc_filter_input').on('input', function (e) { + tocFilterInput.on('input', function (e) { var val = this.value; + //Save filter string to local session storage + if (typeof(Storage) !== "undefined") { + sessionStorage.filterString = val; + } if (val === '') { // Clear 'filtered' class $('#toc li').removeClass(filtered).removeClass(hide); + tocFilterClearButton.fadeOut(); return; } - + tocFilterClearButton.fadeIn(); + // Get leaf nodes $('#toc li>a').filter(function (i, e) { return $(e).siblings().length === 0 @@ -484,6 +497,22 @@ $(function () { return false; } }); + + // toc filter clear button + tocFilterClearButton.hide(); + tocFilterClearButton.on("click", function(e){ + tocFilterInput.val(""); + tocFilterInput.trigger('input'); + if (typeof(Storage) !== "undefined") { + sessionStorage.filterString = ""; + } + }); + + //Set toc filter from local session storage on page load + if (typeof(Storage) !== "undefined") { + tocFilterInput.val(sessionStorage.filterString); + tocFilterInput.trigger('input'); + } } function loadToc() { @@ -547,7 +576,7 @@ $(function () { if ($('footer').is(':visible')) { $(".sideaffix").css("bottom", "70px"); } - $('#affix a').click(function() { + $('#affix a').click(function(e) { var scrollspy = $('[data-spy="scroll"]').data()['bs.scrollspy']; var target = e.target.hash; if (scrollspy && target) { @@ -1132,8 +1161,15 @@ $(function () { } $(window).on('hashchange', scrollToCurrent); - // Exclude tabbed content case - $('a:not([data-tab])').click(delegateAnchors); - scrollToCurrent(); + + $(window).load(function () { + // scroll to the anchor if present, offset by the header + scrollToCurrent(); + }); + + $(document).ready(function () { + // Exclude tabbed content case + $('a:not([data-tab])').click(function (e) { delegateAnchors(e); }); + }); } }); diff --git a/docs/styles/docfx.vendor.js b/docs/styles/docfx.vendor.js index 71bd0cdfe..ff662c6de 100644 --- a/docs/styles/docfx.vendor.js +++ b/docs/styles/docfx.vendor.js @@ -44,9 +44,12 @@ built_in:"ip eip rip al ah bl bh cl ch dl dh sil dil bpl spl r8b r9b r10b r11b r *****************************************************/ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):e.Mark=t(e.jQuery)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},r=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5e3;n(this,e),this.ctx=t,this.iframes=r,this.exclude=i,this.iframesTimeout=o}return r(e,[{key:"getContexts",value:function(){var e=[];return(void 0!==this.ctx&&this.ctx?NodeList.prototype.isPrototypeOf(this.ctx)?Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?this.ctx:"string"==typeof this.ctx?Array.prototype.slice.call(document.querySelectorAll(this.ctx)):[this.ctx]:[]).forEach(function(t){var n=e.filter(function(e){return e.contains(t)}).length>0;-1!==e.indexOf(t)||n||e.push(t)}),e}},{key:"getIframeContents",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=void 0;try{var i=e.contentWindow;if(r=i.document,!i||!r)throw new Error("iframe inaccessible")}catch(e){n()}r&&t(r)}},{key:"isIframeBlank",value:function(e){var t=e.getAttribute("src").trim();return"about:blank"===e.contentWindow.location.href&&"about:blank"!==t&&t}},{key:"observeIframeLoad",value:function(e,t,n){var r=this,i=!1,o=null,a=function a(){if(!i){i=!0,clearTimeout(o);try{r.isIframeBlank(e)||(e.removeEventListener("load",a),r.getIframeContents(e,t,n))}catch(e){n()}}};e.addEventListener("load",a),o=setTimeout(a,this.iframesTimeout)}},{key:"onIframeReady",value:function(e,t,n){try{"complete"===e.contentWindow.document.readyState?this.isIframeBlank(e)?this.observeIframeLoad(e,t,n):this.getIframeContents(e,t,n):this.observeIframeLoad(e,t,n)}catch(e){n()}}},{key:"waitForIframes",value:function(e,t){var n=this,r=0;this.forEachIframe(e,function(){return!0},function(e){r++,n.waitForIframes(e.querySelector("html"),function(){--r||t()})},function(e){e||t()})}},{key:"forEachIframe",value:function(t,n,r){var i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},a=t.querySelectorAll("iframe"),s=a.length,c=0;a=Array.prototype.slice.call(a);var u=function(){--s<=0&&o(c)};s||u(),a.forEach(function(t){e.matches(t,i.exclude)?u():i.onIframeReady(t,function(e){n(t)&&(c++,r(e)),u()},u)})}},{key:"createIterator",value:function(e,t,n){return document.createNodeIterator(e,t,n,!1)}},{key:"createInstanceOnIframe",value:function(t){return new e(t.querySelector("html"),this.iframes)}},{key:"compareNodeIframe",value:function(e,t,n){if(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING){if(null===t)return!0;if(t.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)return!0}return!1}},{key:"getIteratorNode",value:function(e){var t=e.previousNode();return{prevNode:t,node:null===t?e.nextNode():e.nextNode()&&e.nextNode()}}},{key:"checkIframeFilter",value:function(e,t,n,r){var i=!1,o=!1;return r.forEach(function(e,t){e.val===n&&(i=t,o=e.handled)}),this.compareNodeIframe(e,t,n)?(!1!==i||o?!1===i||o||(r[i].handled=!0):r.push({val:n,handled:!0}),!0):(!1===i&&r.push({val:n,handled:!1}),!1)}},{key:"handleOpenIframes",value:function(e,t,n,r){var i=this;e.forEach(function(e){e.handled||i.getIframeContents(e.val,function(e){i.createInstanceOnIframe(e).forEachNode(t,n,r)})})}},{key:"iterateThroughNodes",value:function(e,t,n,r,i){for(var o,a=this,s=this.createIterator(t,e,r),c=[],u=[],l=void 0,h=void 0;void 0,o=a.getIteratorNode(s),h=o.prevNode,l=o.node;)this.iframes&&this.forEachIframe(t,function(e){return a.checkIframeFilter(l,h,e,c)},function(t){a.createInstanceOnIframe(t).forEachNode(e,function(e){return u.push(e)},r)}),u.push(l);u.forEach(function(e){n(e)}),this.iframes&&this.handleOpenIframes(c,e,n,r),i()}},{key:"forEachNode",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},o=this.getContexts(),a=o.length;a||i(),o.forEach(function(o){var s=function(){r.iterateThroughNodes(e,o,t,n,function(){--a<=0&&i()})};r.iframes?r.waitForIframes(o,s):s()})}}],[{key:"matches",value:function(e,t){var n="string"==typeof t?[t]:t,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;if(r){var i=!1;return n.every(function(t){return!r.call(e,t)||(i=!0,!1)}),i}return!1}}]),e}(),a=function(){function e(t){n(this,e),this.ctx=t,this.ie=!1;var r=window.navigator.userAgent;(r.indexOf("MSIE")>-1||r.indexOf("Trident")>-1)&&(this.ie=!0)}return r(e,[{key:"log",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"debug",r=this.opt.log;this.opt.debug&&"object"===(void 0===r?"undefined":t(r))&&"function"==typeof r[n]&&r[n]("mark.js: "+e)}},{key:"escapeStr",value:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}},{key:"createRegExp",value:function(e){return"disabled"!==this.opt.wildcards&&(e=this.setupWildcardsRegExp(e)),e=this.escapeStr(e),Object.keys(this.opt.synonyms).length&&(e=this.createSynonymsRegExp(e)),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),this.opt.diacritics&&(e=this.createDiacriticsRegExp(e)),e=this.createMergedBlanksRegExp(e),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.createJoinersRegExp(e)),"disabled"!==this.opt.wildcards&&(e=this.createWildcardsRegExp(e)),e=this.createAccuracyRegExp(e)}},{key:"createSynonymsRegExp",value:function(e){var t=this.opt.synonyms,n=this.opt.caseSensitive?"":"i",r=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(var i in t)if(t.hasOwnProperty(i)){var o=t[i],a="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(i):this.escapeStr(i),s="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(o):this.escapeStr(o);""!==a&&""!==s&&(e=e.replace(new RegExp("("+this.escapeStr(a)+"|"+this.escapeStr(s)+")","gm"+n),r+"("+this.processSynomyms(a)+"|"+this.processSynomyms(s)+")"+r))}return e}},{key:"processSynomyms",value:function(e){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),e}},{key:"setupWildcardsRegExp",value:function(e){return(e=e.replace(/(?:\\)*\?/g,function(e){return"\\"===e.charAt(0)?"?":""})).replace(/(?:\\)*\*/g,function(e){return"\\"===e.charAt(0)?"*":""})}},{key:"createWildcardsRegExp",value:function(e){var t="withSpaces"===this.opt.wildcards;return e.replace(/\u0001/g,t?"[\\S\\s]?":"\\S?").replace(/\u0002/g,t?"[\\S\\s]*?":"\\S*")}},{key:"setupIgnoreJoinersRegExp",value:function(e){return e.replace(/[^(|)\\]/g,function(e,t,n){var r=n.charAt(t+1);return/[(|)\\]/.test(r)||""===r?e:e+"\0"})}},{key:"createJoinersRegExp",value:function(e){var t=[],n=this.opt.ignorePunctuation;return Array.isArray(n)&&n.length&&t.push(this.escapeStr(n.join(""))),this.opt.ignoreJoiners&&t.push("\\u00ad\\u200b\\u200c\\u200d"),t.length?e.split(/\u0000+/).join("["+t.join("")+"]*"):e}},{key:"createDiacriticsRegExp",value:function(e){var t=this.opt.caseSensitive?"":"i",n=this.opt.caseSensitive?["aàáảãạăằắẳẵặâầấẩẫậäåāą","AÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćč","CÇĆČ","dđď","DĐĎ","eèéẻẽẹêềếểễệëěēę","EÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïī","IÌÍỈĨỊÎÏĪ","lł","LŁ","nñňń","NÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøō","OÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rř","RŘ","sšśșş","SŠŚȘŞ","tťțţ","TŤȚŢ","uùúủũụưừứửữựûüůū","UÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿ","YÝỲỶỸỴŸ","zžżź","ZŽŻŹ"]:["aàáảãạăằắẳẵặâầấẩẫậäåāąAÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćčCÇĆČ","dđďDĐĎ","eèéẻẽẹêềếểễệëěēęEÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïīIÌÍỈĨỊÎÏĪ","lłLŁ","nñňńNÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøōOÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rřRŘ","sšśșşSŠŚȘŞ","tťțţTŤȚŢ","uùúủũụưừứửữựûüůūUÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿYÝỲỶỸỴŸ","zžżźZŽŻŹ"],r=[];return e.split("").forEach(function(i){n.every(function(n){if(-1!==n.indexOf(i)){if(r.indexOf(n)>-1)return!1;e=e.replace(new RegExp("["+n+"]","gm"+t),"["+n+"]"),r.push(n)}return!0})}),e}},{key:"createMergedBlanksRegExp",value:function(e){return e.replace(/[\s]+/gim,"[\\s]+")}},{key:"createAccuracyRegExp",value:function(e){var t=this,n=this.opt.accuracy,r="string"==typeof n?n:n.value,i="";switch(("string"==typeof n?[]:n.limiters).forEach(function(e){i+="|"+t.escapeStr(e)}),r){case"partially":default:return"()("+e+")";case"complementary":return"()([^"+(i="\\s"+(i||this.escapeStr("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~¡¿")))+"]*"+e+"[^"+i+"]*)";case"exactly":return"(^|\\s"+i+")("+e+")(?=$|\\s"+i+")"}}},{key:"getSeparatedKeywords",value:function(e){var t=this,n=[];return e.forEach(function(e){t.opt.separateWordSearch?e.split(" ").forEach(function(e){e.trim()&&-1===n.indexOf(e)&&n.push(e)}):e.trim()&&-1===n.indexOf(e)&&n.push(e)}),{keywords:n.sort(function(e,t){return t.length-e.length}),length:n.length}}},{key:"isNumeric",value:function(e){return Number(parseFloat(e))==e}},{key:"checkRanges",value:function(e){var t=this;if(!Array.isArray(e)||"[object Object]"!==Object.prototype.toString.call(e[0]))return this.log("markRanges() will only accept an array of objects"),this.opt.noMatch(e),[];var n=[],r=0;return e.sort(function(e,t){return e.start-t.start}).forEach(function(e){var i=t.callNoMatchOnInvalidRanges(e,r),o=i.start,a=i.end;i.valid&&(e.start=o,e.length=a-o,n.push(e),r=a)}),n}},{key:"callNoMatchOnInvalidRanges",value:function(e,t){var n=void 0,r=void 0,i=!1;return e&&void 0!==e.start?(r=(n=parseInt(e.start,10))+parseInt(e.length,10),this.isNumeric(e.start)&&this.isNumeric(e.length)&&r-t>0&&r-n>0?i=!0:(this.log("Ignoring invalid or overlapping range: "+JSON.stringify(e)),this.opt.noMatch(e))):(this.log("Ignoring invalid range: "+JSON.stringify(e)),this.opt.noMatch(e)),{start:n,end:r,valid:i}}},{key:"checkWhitespaceRanges",value:function(e,t,n){var r=void 0,i=!0,o=n.length,a=t-o,s=parseInt(e.start,10)-a;return(r=(s=s>o?o:s)+parseInt(e.length,10))>o&&(r=o,this.log("End range automatically set to the max value of "+o)),s<0||r-s<0||s>o||r>o?(i=!1,this.log("Invalid range: "+JSON.stringify(e)),this.opt.noMatch(e)):""===n.substring(s,r).replace(/\s+/g,"")&&(i=!1,this.log("Skipping whitespace only range: "+JSON.stringify(e)),this.opt.noMatch(e)),{start:s,end:r,valid:i}}},{key:"getTextNodes",value:function(e){var t=this,n="",r=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,function(e){r.push({start:n.length,end:(n+=e.textContent).length,node:e})},function(e){return t.matchesExclude(e.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},function(){e({value:n,nodes:r})})}},{key:"matchesExclude",value:function(e){return o.matches(e,this.opt.exclude.concat(["script","style","title","head","html"]))}},{key:"wrapRangeInTextNode",value:function(e,t,n){var r=this.opt.element?this.opt.element:"mark",i=e.splitText(t),o=i.splitText(n-t),a=document.createElement(r);return a.setAttribute("data-markjs","true"),this.opt.className&&a.setAttribute("class",this.opt.className),a.textContent=i.textContent,i.parentNode.replaceChild(a,i),o}},{key:"wrapRangeInMappedTextNode",value:function(e,t,n,r,i){var o=this;e.nodes.every(function(a,s){var c=e.nodes[s+1];if(void 0===c||c.start>t){if(!r(a.node))return!1;var u=t-a.start,l=(n>a.end?a.end:n)-a.start,h=e.value.substr(0,a.start),f=e.value.substr(l+a.start);if(a.node=o.wrapRangeInTextNode(a.node,u,l),e.value=h+f,e.nodes.forEach(function(t,n){n>=s&&(e.nodes[n].start>0&&n!==s&&(e.nodes[n].start-=l),e.nodes[n].end-=l)}),n-=l,i(a.node.previousSibling,a.start),!(n>a.end))return!1;t=a.end}return!0})}},{key:"wrapMatches",value:function(e,t,n,r,i){var o=this,a=0===t?0:t+1;this.getTextNodes(function(t){t.nodes.forEach(function(t){t=t.node;for(var i=void 0;null!==(i=e.exec(t.textContent))&&""!==i[a];)if(n(i[a],t)){var s=i.index;if(0!==a)for(var c=1;c .anchorjs-link, .anchorjs-link:focus { opacity: 1; }",e.sheet.cssRules.length),e.sheet.insertRule(" [data-anchorjs-icon]::after { content: attr(data-anchorjs-icon); }",e.sheet.cssRules.length),e.sheet.insertRule(' @font-face { font-family: "anchorjs-icons"; src: url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype"); }',e.sheet.cssRules.length)}}(),t=document.querySelectorAll("[id]"),i=[].map.call(t,function(A){return A.id}),o=0;o\]\.\/\(\)\*\\\n\t\b\v]/g,"-").replace(/-{2,}/g,"-").substring(0,this.options.truncate).replace(/^-+|-+$/gm,"").toLowerCase()},this.hasAnchorJSLink=function(A){var e=A.firstChild&&-1<(" "+A.firstChild.className+" ").indexOf(" anchorjs-link "),t=A.lastChild&&-1<(" "+A.lastChild.className+" ").indexOf(" anchorjs-link ");return e||t||!1}}}); \ No newline at end of file +// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat +// +// AnchorJS - v4.2.0 - 2019-01-01 +// https://github.com/bryanbraun/anchorjs +// Copyright (c) 2019 Bryan Braun; Licensed MIT +// +// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat +!function(A,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():(A.AnchorJS=e(),A.anchors=new A.AnchorJS)}(this,function(){"use strict";return function(A){function f(A){A.icon=A.hasOwnProperty("icon")?A.icon:"",A.visible=A.hasOwnProperty("visible")?A.visible:"hover",A.placement=A.hasOwnProperty("placement")?A.placement:"right",A.ariaLabel=A.hasOwnProperty("ariaLabel")?A.ariaLabel:"Anchor",A.class=A.hasOwnProperty("class")?A.class:"",A.base=A.hasOwnProperty("base")?A.base:"",A.truncate=A.hasOwnProperty("truncate")?Math.floor(A.truncate):64,A.titleText=A.hasOwnProperty("titleText")?A.titleText:""}function p(A){var e;if("string"==typeof A||A instanceof String)e=[].slice.call(document.querySelectorAll(A));else{if(!(Array.isArray(A)||A instanceof NodeList))throw new Error("The selector provided to AnchorJS was invalid.");e=[].slice.call(A)}return e}this.options=A||{},this.elements=[],f(this.options),this.isTouchDevice=function(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)},this.add=function(A){var e,t,i,n,o,s,a,r,c,h,l,u,d=[];if(f(this.options),"touch"===(l=this.options.visible)&&(l=this.isTouchDevice()?"always":"hover"),A||(A="h2, h3, h4, h5, h6"),0===(e=p(A)).length)return this;for(function(){if(null===document.head.querySelector("style.anchorjs")){var A,e=document.createElement("style");e.className="anchorjs",e.appendChild(document.createTextNode("")),void 0===(A=document.head.querySelector('[rel="stylesheet"], style'))?document.head.appendChild(e):document.head.insertBefore(e,A),e.sheet.insertRule(" .anchorjs-link { opacity: 0; text-decoration: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }",e.sheet.cssRules.length),e.sheet.insertRule(" *:hover > .anchorjs-link, .anchorjs-link:focus { opacity: 1; }",e.sheet.cssRules.length),e.sheet.insertRule(" [data-anchorjs-icon]::after { content: attr(data-anchorjs-icon); }",e.sheet.cssRules.length),e.sheet.insertRule(' @font-face { font-family: "anchorjs-icons"; src: url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype"); }',e.sheet.cssRules.length)}}(),t=document.querySelectorAll("[id]"),i=[].map.call(t,function(A){return A.id}),o=0;o\]\.\/\(\)\*\\\n\t\b\v]/g,"-").replace(/-{2,}/g,"-").substring(0,this.options.truncate).replace(/^-+|-+$/gm,"").toLowerCase()},this.hasAnchorJSLink=function(A){var e=A.firstChild&&-1<(" "+A.firstChild.className+" ").indexOf(" anchorjs-link "),t=A.lastChild&&-1<(" "+A.lastChild.className+" ").indexOf(" anchorjs-link ");return e||t||!1}}}); +// @license-end \ No newline at end of file diff --git a/docs/styles/lunr.min.js b/docs/styles/lunr.min.js index 19335603b..77c29c20c 100644 --- a/docs/styles/lunr.min.js +++ b/docs/styles/lunr.min.js @@ -1 +1 @@ -!function(){var e,t,r,i,n,s,o,a,u,l,d,h,c,f,p,y,m,g,x,v,w,k,Q,L,T,S,b,P,E=function(e){var t=new E.Builder;return t.pipeline.add(E.trimmer,E.stopWordFilter,E.stemmer),t.searchPipeline.add(E.stemmer),e.call(t,t),t.build()};E.version="2.1.2",E.utils={},E.utils.warn=(e=this,function(t){e.console&&console.warn&&console.warn(t)}),E.utils.asString=function(e){return void 0===e||null===e?"":e.toString()},E.FieldRef=function(e,t){this.docRef=e,this.fieldName=t,this._stringValue=t+E.FieldRef.joiner+e},E.FieldRef.joiner="/",E.FieldRef.fromString=function(e){var t=e.indexOf(E.FieldRef.joiner);if(-1===t)throw"malformed field ref string";var r=e.slice(0,t),i=e.slice(t+1);return new E.FieldRef(i,r)},E.FieldRef.prototype.toString=function(){return this._stringValue},E.idf=function(e,t){var r=0;for(var i in e)"_index"!=i&&(r+=Object.keys(e[i]).length);var n=(t-r+.5)/(r+.5);return Math.log(1+Math.abs(n))},E.Token=function(e,t){this.str=e||"",this.metadata=t||{}},E.Token.prototype.toString=function(){return this.str},E.Token.prototype.update=function(e){return this.str=e(this.str,this.metadata),this},E.Token.prototype.clone=function(e){return e=e||function(e){return e},new E.Token(e(this.str,this.metadata),this.metadata)},E.tokenizer=function(e){if(null==e||void 0==e)return[];if(Array.isArray(e))return e.map(function(e){return new E.Token(E.utils.asString(e).toLowerCase())});for(var t=e.toString().trim().toLowerCase(),r=t.length,i=[],n=0,s=0;n<=r;n++){var o=n-s;(t.charAt(n).match(E.tokenizer.separator)||n==r)&&(o>0&&i.push(new E.Token(t.slice(s,n),{position:[s,o],index:i.length})),s=n+1)}return i},E.tokenizer.separator=/[\s\-]+/,E.Pipeline=function(){this._stack=[]},E.Pipeline.registeredFunctions=Object.create(null),E.Pipeline.registerFunction=function(e,t){t in this.registeredFunctions&&E.utils.warn("Overwriting existing registered function: "+t),e.label=t,E.Pipeline.registeredFunctions[e.label]=e},E.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||E.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},E.Pipeline.load=function(e){var t=new E.Pipeline;return e.forEach(function(e){var r=E.Pipeline.registeredFunctions[e];if(!r)throw new Error("Cannot load unregistered function: "+e);t.add(r)}),t},E.Pipeline.prototype.add=function(){Array.prototype.slice.call(arguments).forEach(function(e){E.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)},this)},E.Pipeline.prototype.after=function(e,t){E.Pipeline.warnIfFunctionNotRegistered(t);var r=this._stack.indexOf(e);if(-1==r)throw new Error("Cannot find existingFn");r+=1,this._stack.splice(r,0,t)},E.Pipeline.prototype.before=function(e,t){E.Pipeline.warnIfFunctionNotRegistered(t);var r=this._stack.indexOf(e);if(-1==r)throw new Error("Cannot find existingFn");this._stack.splice(r,0,t)},E.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);-1!=t&&this._stack.splice(t,1)},E.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;r1&&(se&&(r=n),s!=e);)i=r-t,n=t+Math.floor(i/2),s=this.elements[2*n];return s==e?2*n:s>e?2*n:sa?l+=2:o==a&&(t+=r[u+1]*i[l+1],u+=2,l+=2);return t},E.Vector.prototype.similarity=function(e){return this.dot(e)/(this.magnitude()*e.magnitude())},E.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;t0)(s=a.str.charAt(0))in a.node.edges?n=a.node.edges[s]:(n=new E.TokenSet,a.node.edges[s]=n),1==a.str.length?n.final=!0:i.push({node:n,editsRemaining:a.editsRemaining,str:a.str.slice(1)});if(a.editsRemaining>0&&a.str.length>1)(s=a.str.charAt(1))in a.node.edges?o=a.node.edges[s]:(o=new E.TokenSet,a.node.edges[s]=o),a.str.length<=2?o.final=!0:i.push({node:o,editsRemaining:a.editsRemaining-1,str:a.str.slice(2)});if(a.editsRemaining>0&&1==a.str.length&&(a.node.final=!0),a.editsRemaining>0&&a.str.length>=1){if("*"in a.node.edges)var u=a.node.edges["*"];else{u=new E.TokenSet;a.node.edges["*"]=u}1==a.str.length?u.final=!0:i.push({node:u,editsRemaining:a.editsRemaining-1,str:a.str.slice(1)})}if(a.editsRemaining>0){if("*"in a.node.edges)var l=a.node.edges["*"];else{l=new E.TokenSet;a.node.edges["*"]=l}0==a.str.length?l.final=!0:i.push({node:l,editsRemaining:a.editsRemaining-1,str:a.str})}if(a.editsRemaining>0&&a.str.length>1){var d,h=a.str.charAt(0),c=a.str.charAt(1);c in a.node.edges?d=a.node.edges[c]:(d=new E.TokenSet,a.node.edges[c]=d),1==a.str.length?d.final=!0:i.push({node:d,editsRemaining:a.editsRemaining-1,str:h+a.str.slice(2)})}}return r},E.TokenSet.fromString=function(e){for(var t=new E.TokenSet,r=t,i=!1,n=0,s=e.length;n=e;t--){var r=this.uncheckedNodes[t],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}},E.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},E.Index.prototype.search=function(e){return this.query(function(t){new E.QueryParser(e,t).parse()})},E.Index.prototype.query=function(e){var t=new E.Query(this.fields),r=Object.create(null),i=Object.create(null);e.call(t,t);for(var n=0;n1?1:e},E.Builder.prototype.k1=function(e){this._k1=e},E.Builder.prototype.add=function(e){var t=e[this._ref];this.documentCount+=1;for(var r=0;r=this.length)return E.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},E.QueryLexer.prototype.width=function(){return this.pos-this.start},E.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},E.QueryLexer.prototype.backup=function(){this.pos-=1},E.QueryLexer.prototype.acceptDigitRun=function(){var e,t;do{t=(e=this.next()).charCodeAt(0)}while(t>47&&t<58);e!=E.QueryLexer.EOS&&this.backup()},E.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(E.QueryLexer.TERM)),e.ignore(),e.more())return E.QueryLexer.lexText},E.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(E.QueryLexer.EDIT_DISTANCE),E.QueryLexer.lexText},E.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(E.QueryLexer.BOOST),E.QueryLexer.lexText},E.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(E.QueryLexer.TERM)},E.QueryLexer.termSeparator=E.tokenizer.separator,E.QueryLexer.lexText=function(e){for(;;){var t=e.next();if(t==E.QueryLexer.EOS)return E.QueryLexer.lexEOS;if(92!=t.charCodeAt(0)){if(":"==t)return E.QueryLexer.lexField;if("~"==t)return e.backup(),e.width()>0&&e.emit(E.QueryLexer.TERM),E.QueryLexer.lexEditDistance;if("^"==t)return e.backup(),e.width()>0&&e.emit(E.QueryLexer.TERM),E.QueryLexer.lexBoost;if(t.match(E.QueryLexer.termSeparator))return E.QueryLexer.lexTerm}else e.escapeCharacter()}},E.QueryParser=function(e,t){this.lexer=new E.QueryLexer(e),this.query=t,this.currentClause={},this.lexemeIdx=0},E.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=E.QueryParser.parseFieldOrTerm;e;)e=e(this);return this.query},E.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},E.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},E.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},E.QueryParser.parseFieldOrTerm=function(e){var t=e.peekLexeme();if(void 0!=t)switch(t.type){case E.QueryLexer.FIELD:return E.QueryParser.parseField;case E.QueryLexer.TERM:return E.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+t.type;throw t.str.length>=1&&(r+=" with value '"+t.str+"'"),new E.QueryParseError(r,t.start,t.end)}},E.QueryParser.parseField=function(e){var t=e.consumeLexeme();if(void 0!=t){if(-1==e.query.allFields.indexOf(t.str)){var r=e.query.allFields.map(function(e){return"'"+e+"'"}).join(", "),i="unrecognised field '"+t.str+"', possible fields: "+r;throw new E.QueryParseError(i,t.start,t.end)}e.currentClause.fields=[t.str];var n=e.peekLexeme();if(void 0==n){i="expecting term, found nothing";throw new E.QueryParseError(i,t.start,t.end)}switch(n.type){case E.QueryLexer.TERM:return E.QueryParser.parseTerm;default:i="expecting term, found '"+n.type+"'";throw new E.QueryParseError(i,n.start,n.end)}}},E.QueryParser.parseTerm=function(e){var t=e.consumeLexeme();if(void 0!=t){e.currentClause.term=t.str.toLowerCase(),-1!=t.str.indexOf("*")&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(void 0!=r)switch(r.type){case E.QueryLexer.TERM:return e.nextClause(),E.QueryParser.parseTerm;case E.QueryLexer.FIELD:return e.nextClause(),E.QueryParser.parseField;case E.QueryLexer.EDIT_DISTANCE:return E.QueryParser.parseEditDistance;case E.QueryLexer.BOOST:return E.QueryParser.parseBoost;default:var i="Unexpected lexeme type '"+r.type+"'";throw new E.QueryParseError(i,r.start,r.end)}else e.nextClause()}},E.QueryParser.parseEditDistance=function(e){var t=e.consumeLexeme();if(void 0!=t){var r=parseInt(t.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new E.QueryParseError(i,t.start,t.end)}e.currentClause.editDistance=r;var n=e.peekLexeme();if(void 0!=n)switch(n.type){case E.QueryLexer.TERM:return e.nextClause(),E.QueryParser.parseTerm;case E.QueryLexer.FIELD:return e.nextClause(),E.QueryParser.parseField;case E.QueryLexer.EDIT_DISTANCE:return E.QueryParser.parseEditDistance;case E.QueryLexer.BOOST:return E.QueryParser.parseBoost;default:i="Unexpected lexeme type '"+n.type+"'";throw new E.QueryParseError(i,n.start,n.end)}else e.nextClause()}},E.QueryParser.parseBoost=function(e){var t=e.consumeLexeme();if(void 0!=t){var r=parseInt(t.str,10);if(isNaN(r)){var i="boost must be numeric";throw new E.QueryParseError(i,t.start,t.end)}e.currentClause.boost=r;var n=e.peekLexeme();if(void 0!=n)switch(n.type){case E.QueryLexer.TERM:return e.nextClause(),E.QueryParser.parseTerm;case E.QueryLexer.FIELD:return e.nextClause(),E.QueryParser.parseField;case E.QueryLexer.EDIT_DISTANCE:return E.QueryParser.parseEditDistance;case E.QueryLexer.BOOST:return E.QueryParser.parseBoost;default:i="Unexpected lexeme type '"+n.type+"'";throw new E.QueryParseError(i,n.start,n.end)}else e.nextClause()}},b=this,P=function(){return E},"function"==typeof define&&define.amd?define(P):"object"==typeof exports?module.exports=P():b.lunr=P()}(); \ No newline at end of file +!function(){var e,t,r,i,n,s,o,a,u,l,d,h,c,f,p,y,m,g,x,v,w,k,Q,L,T,S,b,P,E=function(e){var t=new E.Builder;return t.pipeline.add(E.trimmer,E.stopWordFilter,E.stemmer),t.searchPipeline.add(E.stemmer),e.call(t,t),t.build()};E.version="2.1.2",E.utils={},E.utils.warn=(e=this,function(t){e.console&&console.warn&&console.warn(t)}),E.utils.asString=function(e){return null==e?"":e.toString()},E.FieldRef=function(e,t){this.docRef=e,this.fieldName=t,this._stringValue=t+E.FieldRef.joiner+e},E.FieldRef.joiner="/",E.FieldRef.fromString=function(e){var t=e.indexOf(E.FieldRef.joiner);if(-1===t)throw"malformed field ref string";var r=e.slice(0,t),i=e.slice(t+1);return new E.FieldRef(i,r)},E.FieldRef.prototype.toString=function(){return this._stringValue},E.idf=function(e,t){var r=0;for(var i in e)"_index"!=i&&(r+=Object.keys(e[i]).length);var n=(t-r+.5)/(r+.5);return Math.log(1+Math.abs(n))},E.Token=function(e,t){this.str=e||"",this.metadata=t||{}},E.Token.prototype.toString=function(){return this.str},E.Token.prototype.update=function(e){return this.str=e(this.str,this.metadata),this},E.Token.prototype.clone=function(e){return e=e||function(e){return e},new E.Token(e(this.str,this.metadata),this.metadata)},E.tokenizer=function(e){if(null==e||null==e)return[];if(Array.isArray(e))return e.map(function(e){return new E.Token(E.utils.asString(e).toLowerCase())});for(var t=e.toString().trim().toLowerCase(),r=t.length,i=[],n=0,s=0;n<=r;n++){var o=n-s;(t.charAt(n).match(E.tokenizer.separator)||n==r)&&(o>0&&i.push(new E.Token(t.slice(s,n),{position:[s,o],index:i.length})),s=n+1)}return i},E.tokenizer.separator=/[\s\-]+/,E.Pipeline=function(){this._stack=[]},E.Pipeline.registeredFunctions=Object.create(null),E.Pipeline.registerFunction=function(e,t){t in this.registeredFunctions&&E.utils.warn("Overwriting existing registered function: "+t),e.label=t,E.Pipeline.registeredFunctions[e.label]=e},E.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||E.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},E.Pipeline.load=function(e){var t=new E.Pipeline;return e.forEach(function(e){var r=E.Pipeline.registeredFunctions[e];if(!r)throw new Error("Cannot load unregistered function: "+e);t.add(r)}),t},E.Pipeline.prototype.add=function(){Array.prototype.slice.call(arguments).forEach(function(e){E.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)},this)},E.Pipeline.prototype.after=function(e,t){E.Pipeline.warnIfFunctionNotRegistered(t);var r=this._stack.indexOf(e);if(-1==r)throw new Error("Cannot find existingFn");r+=1,this._stack.splice(r,0,t)},E.Pipeline.prototype.before=function(e,t){E.Pipeline.warnIfFunctionNotRegistered(t);var r=this._stack.indexOf(e);if(-1==r)throw new Error("Cannot find existingFn");this._stack.splice(r,0,t)},E.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);-1!=t&&this._stack.splice(t,1)},E.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;r1&&(se&&(r=n),s!=e);)i=r-t,n=t+Math.floor(i/2),s=this.elements[2*n];return s==e?2*n:s>e?2*n:sa?l+=2:o==a&&(t+=r[u+1]*i[l+1],u+=2,l+=2);return t},E.Vector.prototype.similarity=function(e){return this.dot(e)/(this.magnitude()*e.magnitude())},E.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;t0)(s=a.str.charAt(0))in a.node.edges?n=a.node.edges[s]:(n=new E.TokenSet,a.node.edges[s]=n),1==a.str.length?n.final=!0:i.push({node:n,editsRemaining:a.editsRemaining,str:a.str.slice(1)});if(a.editsRemaining>0&&a.str.length>1)(s=a.str.charAt(1))in a.node.edges?o=a.node.edges[s]:(o=new E.TokenSet,a.node.edges[s]=o),a.str.length<=2?o.final=!0:i.push({node:o,editsRemaining:a.editsRemaining-1,str:a.str.slice(2)});if(a.editsRemaining>0&&1==a.str.length&&(a.node.final=!0),a.editsRemaining>0&&a.str.length>=1){if("*"in a.node.edges)var u=a.node.edges["*"];else{u=new E.TokenSet;a.node.edges["*"]=u}1==a.str.length?u.final=!0:i.push({node:u,editsRemaining:a.editsRemaining-1,str:a.str.slice(1)})}if(a.editsRemaining>0){if("*"in a.node.edges)var l=a.node.edges["*"];else{l=new E.TokenSet;a.node.edges["*"]=l}0==a.str.length?l.final=!0:i.push({node:l,editsRemaining:a.editsRemaining-1,str:a.str})}if(a.editsRemaining>0&&a.str.length>1){var d,h=a.str.charAt(0),c=a.str.charAt(1);c in a.node.edges?d=a.node.edges[c]:(d=new E.TokenSet,a.node.edges[c]=d),1==a.str.length?d.final=!0:i.push({node:d,editsRemaining:a.editsRemaining-1,str:h+a.str.slice(2)})}}return r},E.TokenSet.fromString=function(e){for(var t=new E.TokenSet,r=t,i=!1,n=0,s=e.length;n=e;t--){var r=this.uncheckedNodes[t],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}},E.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},E.Index.prototype.search=function(e){return this.query(function(t){new E.QueryParser(e,t).parse()})},E.Index.prototype.query=function(e){var t=new E.Query(this.fields),r=Object.create(null),i=Object.create(null);e.call(t,t);for(var n=0;n1?1:e},E.Builder.prototype.k1=function(e){this._k1=e},E.Builder.prototype.add=function(e){var t=e[this._ref];this.documentCount+=1;for(var r=0;r=this.length)return E.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},E.QueryLexer.prototype.width=function(){return this.pos-this.start},E.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},E.QueryLexer.prototype.backup=function(){this.pos-=1},E.QueryLexer.prototype.acceptDigitRun=function(){var e,t;do{t=(e=this.next()).charCodeAt(0)}while(t>47&&t<58);e!=E.QueryLexer.EOS&&this.backup()},E.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(E.QueryLexer.TERM)),e.ignore(),e.more())return E.QueryLexer.lexText},E.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(E.QueryLexer.EDIT_DISTANCE),E.QueryLexer.lexText},E.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(E.QueryLexer.BOOST),E.QueryLexer.lexText},E.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(E.QueryLexer.TERM)},E.QueryLexer.termSeparator=E.tokenizer.separator,E.QueryLexer.lexText=function(e){for(;;){var t=e.next();if(t==E.QueryLexer.EOS)return E.QueryLexer.lexEOS;if(92!=t.charCodeAt(0)){if(":"==t)return E.QueryLexer.lexField;if("~"==t)return e.backup(),e.width()>0&&e.emit(E.QueryLexer.TERM),E.QueryLexer.lexEditDistance;if("^"==t)return e.backup(),e.width()>0&&e.emit(E.QueryLexer.TERM),E.QueryLexer.lexBoost;if(t.match(E.QueryLexer.termSeparator))return E.QueryLexer.lexTerm}else e.escapeCharacter()}},E.QueryParser=function(e,t){this.lexer=new E.QueryLexer(e),this.query=t,this.currentClause={},this.lexemeIdx=0},E.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=E.QueryParser.parseFieldOrTerm;e;)e=e(this);return this.query},E.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},E.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},E.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},E.QueryParser.parseFieldOrTerm=function(e){var t=e.peekLexeme();if(null!=t)switch(t.type){case E.QueryLexer.FIELD:return E.QueryParser.parseField;case E.QueryLexer.TERM:return E.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+t.type;throw t.str.length>=1&&(r+=" with value '"+t.str+"'"),new E.QueryParseError(r,t.start,t.end)}},E.QueryParser.parseField=function(e){var t=e.consumeLexeme();if(null!=t){if(-1==e.query.allFields.indexOf(t.str)){var r=e.query.allFields.map(function(e){return"'"+e+"'"}).join(", "),i="unrecognised field '"+t.str+"', possible fields: "+r;throw new E.QueryParseError(i,t.start,t.end)}e.currentClause.fields=[t.str];var n=e.peekLexeme();if(null==n){i="expecting term, found nothing";throw new E.QueryParseError(i,t.start,t.end)}switch(n.type){case E.QueryLexer.TERM:return E.QueryParser.parseTerm;default:i="expecting term, found '"+n.type+"'";throw new E.QueryParseError(i,n.start,n.end)}}},E.QueryParser.parseTerm=function(e){var t=e.consumeLexeme();if(null!=t){e.currentClause.term=t.str.toLowerCase(),-1!=t.str.indexOf("*")&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(null!=r)switch(r.type){case E.QueryLexer.TERM:return e.nextClause(),E.QueryParser.parseTerm;case E.QueryLexer.FIELD:return e.nextClause(),E.QueryParser.parseField;case E.QueryLexer.EDIT_DISTANCE:return E.QueryParser.parseEditDistance;case E.QueryLexer.BOOST:return E.QueryParser.parseBoost;default:var i="Unexpected lexeme type '"+r.type+"'";throw new E.QueryParseError(i,r.start,r.end)}else e.nextClause()}},E.QueryParser.parseEditDistance=function(e){var t=e.consumeLexeme();if(null!=t){var r=parseInt(t.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new E.QueryParseError(i,t.start,t.end)}e.currentClause.editDistance=r;var n=e.peekLexeme();if(null!=n)switch(n.type){case E.QueryLexer.TERM:return e.nextClause(),E.QueryParser.parseTerm;case E.QueryLexer.FIELD:return e.nextClause(),E.QueryParser.parseField;case E.QueryLexer.EDIT_DISTANCE:return E.QueryParser.parseEditDistance;case E.QueryLexer.BOOST:return E.QueryParser.parseBoost;default:i="Unexpected lexeme type '"+n.type+"'";throw new E.QueryParseError(i,n.start,n.end)}else e.nextClause()}},E.QueryParser.parseBoost=function(e){var t=e.consumeLexeme();if(null!=t){var r=parseInt(t.str,10);if(isNaN(r)){var i="boost must be numeric";throw new E.QueryParseError(i,t.start,t.end)}e.currentClause.boost=r;var n=e.peekLexeme();if(null!=n)switch(n.type){case E.QueryLexer.TERM:return e.nextClause(),E.QueryParser.parseTerm;case E.QueryLexer.FIELD:return e.nextClause(),E.QueryParser.parseField;case E.QueryLexer.EDIT_DISTANCE:return E.QueryParser.parseEditDistance;case E.QueryLexer.BOOST:return E.QueryParser.parseBoost;default:i="Unexpected lexeme type '"+n.type+"'";throw new E.QueryParseError(i,n.start,n.end)}else e.nextClause()}},b=this,P=function(){return E},"function"==typeof define&&define.amd?define(P):"object"==typeof exports?module.exports=P():b.lunr=P()}(); \ No newline at end of file diff --git a/docs/styles/search-worker.js b/docs/styles/search-worker.js index 9c1bcf215..257320ca6 100644 --- a/docs/styles/search-worker.js +++ b/docs/styles/search-worker.js @@ -6,7 +6,7 @@ var stopWords = null; var searchData = {}; - lunr.tokenizer.seperator = /[\s\-\.]+/; + lunr.tokenizer.separator = /[\s\-\.]+/; var stopWordsRequest = new XMLHttpRequest(); stopWordsRequest.open('GET', '../search-stopwords.json'); diff --git a/docs/xrefmap.yml b/docs/xrefmap.yml index 0bdf27db4..07236273b 100644 --- a/docs/xrefmap.yml +++ b/docs/xrefmap.yml @@ -73,6 +73,22 @@ references: commentId: T:Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs fullName: Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs nameWithType: CertificateSelectionEventArgs +- uid: Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.#ctor(Titanium.Web.Proxy.EventArguments.SessionEventArgsBase,System.String,System.Security.Cryptography.X509Certificates.X509CertificateCollection,System.Security.Cryptography.X509Certificates.X509Certificate,System.String[]) + name: CertificateSelectionEventArgs(SessionEventArgsBase, String, X509CertificateCollection, X509Certificate, String[]) + href: api/Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.html#Titanium_Web_Proxy_EventArguments_CertificateSelectionEventArgs__ctor_Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_System_String_System_Security_Cryptography_X509Certificates_X509CertificateCollection_System_Security_Cryptography_X509Certificates_X509Certificate_System_String___ + commentId: M:Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.#ctor(Titanium.Web.Proxy.EventArguments.SessionEventArgsBase,System.String,System.Security.Cryptography.X509Certificates.X509CertificateCollection,System.Security.Cryptography.X509Certificates.X509Certificate,System.String[]) + name.vb: CertificateSelectionEventArgs(SessionEventArgsBase, String, X509CertificateCollection, X509Certificate, String()) + fullName: Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.CertificateSelectionEventArgs(Titanium.Web.Proxy.EventArguments.SessionEventArgsBase, System.String, System.Security.Cryptography.X509Certificates.X509CertificateCollection, System.Security.Cryptography.X509Certificates.X509Certificate, System.String[]) + fullName.vb: Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.CertificateSelectionEventArgs(Titanium.Web.Proxy.EventArguments.SessionEventArgsBase, System.String, System.Security.Cryptography.X509Certificates.X509CertificateCollection, System.Security.Cryptography.X509Certificates.X509Certificate, System.String()) + nameWithType: CertificateSelectionEventArgs.CertificateSelectionEventArgs(SessionEventArgsBase, String, X509CertificateCollection, X509Certificate, String[]) + nameWithType.vb: CertificateSelectionEventArgs.CertificateSelectionEventArgs(SessionEventArgsBase, String, X509CertificateCollection, X509Certificate, String()) +- uid: Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.#ctor* + name: CertificateSelectionEventArgs + href: api/Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.html#Titanium_Web_Proxy_EventArguments_CertificateSelectionEventArgs__ctor_ + commentId: Overload:Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.#ctor + isSpec: "True" + fullName: Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.CertificateSelectionEventArgs + nameWithType: CertificateSelectionEventArgs.CertificateSelectionEventArgs - uid: Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.AcceptableIssuers name: AcceptableIssuers href: api/Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.html#Titanium_Web_Proxy_EventArguments_CertificateSelectionEventArgs_AcceptableIssuers @@ -125,19 +141,19 @@ references: isSpec: "True" fullName: Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.RemoteCertificate nameWithType: CertificateSelectionEventArgs.RemoteCertificate -- uid: Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.Sender - name: Sender - href: api/Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.html#Titanium_Web_Proxy_EventArguments_CertificateSelectionEventArgs_Sender - commentId: P:Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.Sender - fullName: Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.Sender - nameWithType: CertificateSelectionEventArgs.Sender -- uid: Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.Sender* - name: Sender - href: api/Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.html#Titanium_Web_Proxy_EventArguments_CertificateSelectionEventArgs_Sender_ - commentId: Overload:Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.Sender - isSpec: "True" - fullName: Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.Sender - nameWithType: CertificateSelectionEventArgs.Sender +- uid: Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.Session + name: Session + href: api/Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.html#Titanium_Web_Proxy_EventArguments_CertificateSelectionEventArgs_Session + commentId: P:Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.Session + fullName: Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.Session + nameWithType: CertificateSelectionEventArgs.Session +- uid: Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.Session* + name: Session + href: api/Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.html#Titanium_Web_Proxy_EventArguments_CertificateSelectionEventArgs_Session_ + commentId: Overload:Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.Session + isSpec: "True" + fullName: Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.Session + nameWithType: CertificateSelectionEventArgs.Session - uid: Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.TargetHost name: TargetHost href: api/Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.html#Titanium_Web_Proxy_EventArguments_CertificateSelectionEventArgs_TargetHost @@ -157,6 +173,19 @@ references: commentId: T:Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs fullName: Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs nameWithType: CertificateValidationEventArgs +- uid: Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.#ctor(Titanium.Web.Proxy.EventArguments.SessionEventArgsBase,System.Security.Cryptography.X509Certificates.X509Certificate,System.Security.Cryptography.X509Certificates.X509Chain,System.Net.Security.SslPolicyErrors) + name: CertificateValidationEventArgs(SessionEventArgsBase, X509Certificate, X509Chain, SslPolicyErrors) + href: api/Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.html#Titanium_Web_Proxy_EventArguments_CertificateValidationEventArgs__ctor_Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_System_Security_Cryptography_X509Certificates_X509Certificate_System_Security_Cryptography_X509Certificates_X509Chain_System_Net_Security_SslPolicyErrors_ + commentId: M:Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.#ctor(Titanium.Web.Proxy.EventArguments.SessionEventArgsBase,System.Security.Cryptography.X509Certificates.X509Certificate,System.Security.Cryptography.X509Certificates.X509Chain,System.Net.Security.SslPolicyErrors) + fullName: Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.CertificateValidationEventArgs(Titanium.Web.Proxy.EventArguments.SessionEventArgsBase, System.Security.Cryptography.X509Certificates.X509Certificate, System.Security.Cryptography.X509Certificates.X509Chain, System.Net.Security.SslPolicyErrors) + nameWithType: CertificateValidationEventArgs.CertificateValidationEventArgs(SessionEventArgsBase, X509Certificate, X509Chain, SslPolicyErrors) +- uid: Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.#ctor* + name: CertificateValidationEventArgs + href: api/Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.html#Titanium_Web_Proxy_EventArguments_CertificateValidationEventArgs__ctor_ + commentId: Overload:Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.#ctor + isSpec: "True" + fullName: Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.CertificateValidationEventArgs + nameWithType: CertificateValidationEventArgs.CertificateValidationEventArgs - uid: Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.Certificate name: Certificate href: api/Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.html#Titanium_Web_Proxy_EventArguments_CertificateValidationEventArgs_Certificate @@ -196,6 +225,19 @@ references: isSpec: "True" fullName: Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.IsValid nameWithType: CertificateValidationEventArgs.IsValid +- uid: Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.Session + name: Session + href: api/Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.html#Titanium_Web_Proxy_EventArguments_CertificateValidationEventArgs_Session + commentId: P:Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.Session + fullName: Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.Session + nameWithType: CertificateValidationEventArgs.Session +- uid: Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.Session* + name: Session + href: api/Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.html#Titanium_Web_Proxy_EventArguments_CertificateValidationEventArgs_Session_ + commentId: Overload:Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.Session + isSpec: "True" + fullName: Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.Session + nameWithType: CertificateValidationEventArgs.Session - uid: Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.SslPolicyErrors name: SslPolicyErrors href: api/Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.html#Titanium_Web_Proxy_EventArguments_CertificateValidationEventArgs_SslPolicyErrors @@ -241,25 +283,25 @@ references: isSpec: "True" fullName: Titanium.Web.Proxy.EventArguments.MultipartRequestPartSentEventArgs.Headers nameWithType: MultipartRequestPartSentEventArgs.Headers +- uid: Titanium.Web.Proxy.EventArguments.MultipartRequestPartSentEventArgs.Session + name: Session + href: api/Titanium.Web.Proxy.EventArguments.MultipartRequestPartSentEventArgs.html#Titanium_Web_Proxy_EventArguments_MultipartRequestPartSentEventArgs_Session + commentId: P:Titanium.Web.Proxy.EventArguments.MultipartRequestPartSentEventArgs.Session + fullName: Titanium.Web.Proxy.EventArguments.MultipartRequestPartSentEventArgs.Session + nameWithType: MultipartRequestPartSentEventArgs.Session +- uid: Titanium.Web.Proxy.EventArguments.MultipartRequestPartSentEventArgs.Session* + name: Session + href: api/Titanium.Web.Proxy.EventArguments.MultipartRequestPartSentEventArgs.html#Titanium_Web_Proxy_EventArguments_MultipartRequestPartSentEventArgs_Session_ + commentId: Overload:Titanium.Web.Proxy.EventArguments.MultipartRequestPartSentEventArgs.Session + isSpec: "True" + fullName: Titanium.Web.Proxy.EventArguments.MultipartRequestPartSentEventArgs.Session + nameWithType: MultipartRequestPartSentEventArgs.Session - uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs name: SessionEventArgs href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html commentId: T:Titanium.Web.Proxy.EventArguments.SessionEventArgs fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs nameWithType: SessionEventArgs -- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.#ctor(Titanium.Web.Proxy.ProxyServer,Titanium.Web.Proxy.Models.ProxyEndPoint,Titanium.Web.Proxy.Http.Request,System.Threading.CancellationTokenSource) - name: SessionEventArgs(ProxyServer, ProxyEndPoint, Request, CancellationTokenSource) - href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs__ctor_Titanium_Web_Proxy_ProxyServer_Titanium_Web_Proxy_Models_ProxyEndPoint_Titanium_Web_Proxy_Http_Request_System_Threading_CancellationTokenSource_ - commentId: M:Titanium.Web.Proxy.EventArguments.SessionEventArgs.#ctor(Titanium.Web.Proxy.ProxyServer,Titanium.Web.Proxy.Models.ProxyEndPoint,Titanium.Web.Proxy.Http.Request,System.Threading.CancellationTokenSource) - fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.SessionEventArgs(Titanium.Web.Proxy.ProxyServer, Titanium.Web.Proxy.Models.ProxyEndPoint, Titanium.Web.Proxy.Http.Request, System.Threading.CancellationTokenSource) - nameWithType: SessionEventArgs.SessionEventArgs(ProxyServer, ProxyEndPoint, Request, CancellationTokenSource) -- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.#ctor* - name: SessionEventArgs - href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs__ctor_ - commentId: Overload:Titanium.Web.Proxy.EventArguments.SessionEventArgs.#ctor - isSpec: "True" - fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.SessionEventArgs - nameWithType: SessionEventArgs.SessionEventArgs - uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Dispose name: Dispose() href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs_Dispose @@ -504,31 +546,44 @@ references: isSpec: "True" fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.TerminateServerConnection nameWithType: SessionEventArgs.TerminateServerConnection +- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.WebSocketDecoder + name: WebSocketDecoder + href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs_WebSocketDecoder + commentId: P:Titanium.Web.Proxy.EventArguments.SessionEventArgs.WebSocketDecoder + fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.WebSocketDecoder + nameWithType: SessionEventArgs.WebSocketDecoder +- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.WebSocketDecoder* + name: WebSocketDecoder + href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs_WebSocketDecoder_ + commentId: Overload:Titanium.Web.Proxy.EventArguments.SessionEventArgs.WebSocketDecoder + isSpec: "True" + fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.WebSocketDecoder + nameWithType: SessionEventArgs.WebSocketDecoder - uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase name: SessionEventArgsBase href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html commentId: T:Titanium.Web.Proxy.EventArguments.SessionEventArgsBase fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase nameWithType: SessionEventArgsBase -- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.#ctor(Titanium.Web.Proxy.ProxyServer,Titanium.Web.Proxy.Models.ProxyEndPoint,System.Threading.CancellationTokenSource,Titanium.Web.Proxy.Http.Request) - name: SessionEventArgsBase(ProxyServer, ProxyEndPoint, CancellationTokenSource, Request) - href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase__ctor_Titanium_Web_Proxy_ProxyServer_Titanium_Web_Proxy_Models_ProxyEndPoint_System_Threading_CancellationTokenSource_Titanium_Web_Proxy_Http_Request_ - commentId: M:Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.#ctor(Titanium.Web.Proxy.ProxyServer,Titanium.Web.Proxy.Models.ProxyEndPoint,System.Threading.CancellationTokenSource,Titanium.Web.Proxy.Http.Request) - fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.SessionEventArgsBase(Titanium.Web.Proxy.ProxyServer, Titanium.Web.Proxy.Models.ProxyEndPoint, System.Threading.CancellationTokenSource, Titanium.Web.Proxy.Http.Request) - nameWithType: SessionEventArgsBase.SessionEventArgsBase(ProxyServer, ProxyEndPoint, CancellationTokenSource, Request) -- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.#ctor* - name: SessionEventArgsBase - href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase__ctor_ - commentId: Overload:Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.#ctor - isSpec: "True" - fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.SessionEventArgsBase - nameWithType: SessionEventArgsBase.SessionEventArgsBase - uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.BufferPool name: BufferPool href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_BufferPool commentId: F:Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.BufferPool fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.BufferPool nameWithType: SessionEventArgsBase.BufferPool +- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ClientConnectionId + name: ClientConnectionId + href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_ClientConnectionId + commentId: P:Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ClientConnectionId + fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ClientConnectionId + nameWithType: SessionEventArgsBase.ClientConnectionId +- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ClientConnectionId* + name: ClientConnectionId + href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_ClientConnectionId_ + commentId: Overload:Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ClientConnectionId + isSpec: "True" + fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ClientConnectionId + nameWithType: SessionEventArgsBase.ClientConnectionId - uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ClientEndPoint name: ClientEndPoint href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_ClientEndPoint @@ -542,6 +597,45 @@ references: isSpec: "True" fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ClientEndPoint nameWithType: SessionEventArgsBase.ClientEndPoint +- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ClientLocalEndPoint + name: ClientLocalEndPoint + href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_ClientLocalEndPoint + commentId: P:Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ClientLocalEndPoint + fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ClientLocalEndPoint + nameWithType: SessionEventArgsBase.ClientLocalEndPoint +- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ClientLocalEndPoint* + name: ClientLocalEndPoint + href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_ClientLocalEndPoint_ + commentId: Overload:Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ClientLocalEndPoint + isSpec: "True" + fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ClientLocalEndPoint + nameWithType: SessionEventArgsBase.ClientLocalEndPoint +- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ClientRemoteEndPoint + name: ClientRemoteEndPoint + href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_ClientRemoteEndPoint + commentId: P:Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ClientRemoteEndPoint + fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ClientRemoteEndPoint + nameWithType: SessionEventArgsBase.ClientRemoteEndPoint +- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ClientRemoteEndPoint* + name: ClientRemoteEndPoint + href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_ClientRemoteEndPoint_ + commentId: Overload:Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ClientRemoteEndPoint + isSpec: "True" + fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ClientRemoteEndPoint + nameWithType: SessionEventArgsBase.ClientRemoteEndPoint +- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.CustomUpStreamProxy + name: CustomUpStreamProxy + href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_CustomUpStreamProxy + commentId: P:Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.CustomUpStreamProxy + fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.CustomUpStreamProxy + nameWithType: SessionEventArgsBase.CustomUpStreamProxy +- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.CustomUpStreamProxy* + name: CustomUpStreamProxy + href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_CustomUpStreamProxy_ + commentId: Overload:Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.CustomUpStreamProxy + isSpec: "True" + fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.CustomUpStreamProxy + nameWithType: SessionEventArgsBase.CustomUpStreamProxy - uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.CustomUpStreamProxyUsed name: CustomUpStreamProxyUsed href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_CustomUpStreamProxyUsed @@ -580,6 +674,19 @@ references: isSpec: "True" fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.Dispose nameWithType: SessionEventArgsBase.Dispose +- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.EnableWinAuth + name: EnableWinAuth + href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_EnableWinAuth + commentId: P:Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.EnableWinAuth + fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.EnableWinAuth + nameWithType: SessionEventArgsBase.EnableWinAuth +- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.EnableWinAuth* + name: EnableWinAuth + href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_EnableWinAuth_ + commentId: Overload:Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.EnableWinAuth + isSpec: "True" + fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.EnableWinAuth + nameWithType: SessionEventArgsBase.EnableWinAuth - uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.Exception name: Exception href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_Exception @@ -651,6 +758,32 @@ references: isSpec: "True" fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.LocalEndPoint nameWithType: SessionEventArgsBase.LocalEndPoint +- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ProxyEndPoint + name: ProxyEndPoint + href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_ProxyEndPoint + commentId: P:Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ProxyEndPoint + fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ProxyEndPoint + nameWithType: SessionEventArgsBase.ProxyEndPoint +- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ProxyEndPoint* + name: ProxyEndPoint + href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_ProxyEndPoint_ + commentId: Overload:Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ProxyEndPoint + isSpec: "True" + fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ProxyEndPoint + nameWithType: SessionEventArgsBase.ProxyEndPoint +- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ServerConnectionId + name: ServerConnectionId + href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_ServerConnectionId + commentId: P:Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ServerConnectionId + fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ServerConnectionId + nameWithType: SessionEventArgsBase.ServerConnectionId +- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ServerConnectionId* + name: ServerConnectionId + href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_ServerConnectionId_ + commentId: Overload:Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ServerConnectionId + isSpec: "True" + fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.ServerConnectionId + nameWithType: SessionEventArgsBase.ServerConnectionId - uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.TerminateSession name: TerminateSession() href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_TerminateSession @@ -917,6 +1050,19 @@ references: isSpec: "True" fullName: Titanium.Web.Proxy.Helpers.RunTime.IsMac nameWithType: RunTime.IsMac +- uid: Titanium.Web.Proxy.Helpers.RunTime.IsSocketReuseAvailable + name: IsSocketReuseAvailable + href: api/Titanium.Web.Proxy.Helpers.RunTime.html#Titanium_Web_Proxy_Helpers_RunTime_IsSocketReuseAvailable + commentId: P:Titanium.Web.Proxy.Helpers.RunTime.IsSocketReuseAvailable + fullName: Titanium.Web.Proxy.Helpers.RunTime.IsSocketReuseAvailable + nameWithType: RunTime.IsSocketReuseAvailable +- uid: Titanium.Web.Proxy.Helpers.RunTime.IsSocketReuseAvailable* + name: IsSocketReuseAvailable + href: api/Titanium.Web.Proxy.Helpers.RunTime.html#Titanium_Web_Proxy_Helpers_RunTime_IsSocketReuseAvailable_ + commentId: Overload:Titanium.Web.Proxy.Helpers.RunTime.IsSocketReuseAvailable + isSpec: "True" + fullName: Titanium.Web.Proxy.Helpers.RunTime.IsSocketReuseAvailable + nameWithType: RunTime.IsSocketReuseAvailable - uid: Titanium.Web.Proxy.Helpers.RunTime.IsUwpOnWindows name: IsUwpOnWindows href: api/Titanium.Web.Proxy.Helpers.RunTime.html#Titanium_Web_Proxy_Helpers_RunTime_IsUwpOnWindows @@ -955,19 +1101,6 @@ references: commentId: T:Titanium.Web.Proxy.Http.ConnectRequest fullName: Titanium.Web.Proxy.Http.ConnectRequest nameWithType: ConnectRequest -- uid: Titanium.Web.Proxy.Http.ConnectRequest.#ctor - name: ConnectRequest() - href: api/Titanium.Web.Proxy.Http.ConnectRequest.html#Titanium_Web_Proxy_Http_ConnectRequest__ctor - commentId: M:Titanium.Web.Proxy.Http.ConnectRequest.#ctor - fullName: Titanium.Web.Proxy.Http.ConnectRequest.ConnectRequest() - nameWithType: ConnectRequest.ConnectRequest() -- uid: Titanium.Web.Proxy.Http.ConnectRequest.#ctor* - name: ConnectRequest - href: api/Titanium.Web.Proxy.Http.ConnectRequest.html#Titanium_Web_Proxy_Http_ConnectRequest__ctor_ - commentId: Overload:Titanium.Web.Proxy.Http.ConnectRequest.#ctor - isSpec: "True" - fullName: Titanium.Web.Proxy.Http.ConnectRequest.ConnectRequest - nameWithType: ConnectRequest.ConnectRequest - uid: Titanium.Web.Proxy.Http.ConnectRequest.ClientHelloInfo name: ClientHelloInfo href: api/Titanium.Web.Proxy.Http.ConnectRequest.html#Titanium_Web_Proxy_Http_ConnectRequest_ClientHelloInfo @@ -1189,6 +1322,12 @@ references: isSpec: "True" fullName: Titanium.Web.Proxy.Http.HeaderCollection.NonUniqueHeaders nameWithType: HeaderCollection.NonUniqueHeaders +- uid: Titanium.Web.Proxy.Http.HeaderCollection.RemoveHeader(KnownHeader) + name: RemoveHeader(KnownHeader) + href: api/Titanium.Web.Proxy.Http.HeaderCollection.html#Titanium_Web_Proxy_Http_HeaderCollection_RemoveHeader_KnownHeader_ + commentId: M:Titanium.Web.Proxy.Http.HeaderCollection.RemoveHeader(KnownHeader) + fullName: Titanium.Web.Proxy.Http.HeaderCollection.RemoveHeader(KnownHeader) + nameWithType: HeaderCollection.RemoveHeader(KnownHeader) - uid: Titanium.Web.Proxy.Http.HeaderCollection.RemoveHeader(System.String) name: RemoveHeader(String) href: api/Titanium.Web.Proxy.Http.HeaderCollection.html#Titanium_Web_Proxy_Http_HeaderCollection_RemoveHeader_System_String_ @@ -1607,19 +1746,6 @@ references: isSpec: "True" fullName: Titanium.Web.Proxy.Http.Request.Method nameWithType: Request.Method -- uid: Titanium.Web.Proxy.Http.Request.OriginalUrl - name: OriginalUrl - href: api/Titanium.Web.Proxy.Http.Request.html#Titanium_Web_Proxy_Http_Request_OriginalUrl - commentId: P:Titanium.Web.Proxy.Http.Request.OriginalUrl - fullName: Titanium.Web.Proxy.Http.Request.OriginalUrl - nameWithType: Request.OriginalUrl -- uid: Titanium.Web.Proxy.Http.Request.OriginalUrl* - name: OriginalUrl - href: api/Titanium.Web.Proxy.Http.Request.html#Titanium_Web_Proxy_Http_Request_OriginalUrl_ - commentId: Overload:Titanium.Web.Proxy.Http.Request.OriginalUrl - isSpec: "True" - fullName: Titanium.Web.Proxy.Http.Request.OriginalUrl - nameWithType: Request.OriginalUrl - uid: Titanium.Web.Proxy.Http.Request.RequestUri name: RequestUri href: api/Titanium.Web.Proxy.Http.Request.html#Titanium_Web_Proxy_Http_Request_RequestUri @@ -2050,77 +2176,6 @@ references: commentId: N:Titanium.Web.Proxy.Http2.Hpack fullName: Titanium.Web.Proxy.Http2.Hpack nameWithType: Titanium.Web.Proxy.Http2.Hpack -- uid: Titanium.Web.Proxy.Http2.Hpack.Decoder - name: Decoder - href: api/Titanium.Web.Proxy.Http2.Hpack.Decoder.html - commentId: T:Titanium.Web.Proxy.Http2.Hpack.Decoder - fullName: Titanium.Web.Proxy.Http2.Hpack.Decoder - nameWithType: Decoder -- uid: Titanium.Web.Proxy.Http2.Hpack.Decoder.#ctor(System.Int32,System.Int32) - name: Decoder(Int32, Int32) - href: api/Titanium.Web.Proxy.Http2.Hpack.Decoder.html#Titanium_Web_Proxy_Http2_Hpack_Decoder__ctor_System_Int32_System_Int32_ - commentId: M:Titanium.Web.Proxy.Http2.Hpack.Decoder.#ctor(System.Int32,System.Int32) - fullName: Titanium.Web.Proxy.Http2.Hpack.Decoder.Decoder(System.Int32, System.Int32) - nameWithType: Decoder.Decoder(Int32, Int32) -- uid: Titanium.Web.Proxy.Http2.Hpack.Decoder.#ctor* - name: Decoder - href: api/Titanium.Web.Proxy.Http2.Hpack.Decoder.html#Titanium_Web_Proxy_Http2_Hpack_Decoder__ctor_ - commentId: Overload:Titanium.Web.Proxy.Http2.Hpack.Decoder.#ctor - isSpec: "True" - fullName: Titanium.Web.Proxy.Http2.Hpack.Decoder.Decoder - nameWithType: Decoder.Decoder -- uid: Titanium.Web.Proxy.Http2.Hpack.Decoder.Decode(System.IO.BinaryReader,Titanium.Web.Proxy.Http2.Hpack.IHeaderListener) - name: Decode(BinaryReader, IHeaderListener) - href: api/Titanium.Web.Proxy.Http2.Hpack.Decoder.html#Titanium_Web_Proxy_Http2_Hpack_Decoder_Decode_System_IO_BinaryReader_Titanium_Web_Proxy_Http2_Hpack_IHeaderListener_ - commentId: M:Titanium.Web.Proxy.Http2.Hpack.Decoder.Decode(System.IO.BinaryReader,Titanium.Web.Proxy.Http2.Hpack.IHeaderListener) - fullName: Titanium.Web.Proxy.Http2.Hpack.Decoder.Decode(System.IO.BinaryReader, Titanium.Web.Proxy.Http2.Hpack.IHeaderListener) - nameWithType: Decoder.Decode(BinaryReader, IHeaderListener) -- uid: Titanium.Web.Proxy.Http2.Hpack.Decoder.Decode* - name: Decode - href: api/Titanium.Web.Proxy.Http2.Hpack.Decoder.html#Titanium_Web_Proxy_Http2_Hpack_Decoder_Decode_ - commentId: Overload:Titanium.Web.Proxy.Http2.Hpack.Decoder.Decode - isSpec: "True" - fullName: Titanium.Web.Proxy.Http2.Hpack.Decoder.Decode - nameWithType: Decoder.Decode -- uid: Titanium.Web.Proxy.Http2.Hpack.Decoder.EndHeaderBlock - name: EndHeaderBlock() - href: api/Titanium.Web.Proxy.Http2.Hpack.Decoder.html#Titanium_Web_Proxy_Http2_Hpack_Decoder_EndHeaderBlock - commentId: M:Titanium.Web.Proxy.Http2.Hpack.Decoder.EndHeaderBlock - fullName: Titanium.Web.Proxy.Http2.Hpack.Decoder.EndHeaderBlock() - nameWithType: Decoder.EndHeaderBlock() -- uid: Titanium.Web.Proxy.Http2.Hpack.Decoder.EndHeaderBlock* - name: EndHeaderBlock - href: api/Titanium.Web.Proxy.Http2.Hpack.Decoder.html#Titanium_Web_Proxy_Http2_Hpack_Decoder_EndHeaderBlock_ - commentId: Overload:Titanium.Web.Proxy.Http2.Hpack.Decoder.EndHeaderBlock - isSpec: "True" - fullName: Titanium.Web.Proxy.Http2.Hpack.Decoder.EndHeaderBlock - nameWithType: Decoder.EndHeaderBlock -- uid: Titanium.Web.Proxy.Http2.Hpack.Decoder.GetMaxHeaderTableSize - name: GetMaxHeaderTableSize() - href: api/Titanium.Web.Proxy.Http2.Hpack.Decoder.html#Titanium_Web_Proxy_Http2_Hpack_Decoder_GetMaxHeaderTableSize - commentId: M:Titanium.Web.Proxy.Http2.Hpack.Decoder.GetMaxHeaderTableSize - fullName: Titanium.Web.Proxy.Http2.Hpack.Decoder.GetMaxHeaderTableSize() - nameWithType: Decoder.GetMaxHeaderTableSize() -- uid: Titanium.Web.Proxy.Http2.Hpack.Decoder.GetMaxHeaderTableSize* - name: GetMaxHeaderTableSize - href: api/Titanium.Web.Proxy.Http2.Hpack.Decoder.html#Titanium_Web_Proxy_Http2_Hpack_Decoder_GetMaxHeaderTableSize_ - commentId: Overload:Titanium.Web.Proxy.Http2.Hpack.Decoder.GetMaxHeaderTableSize - isSpec: "True" - fullName: Titanium.Web.Proxy.Http2.Hpack.Decoder.GetMaxHeaderTableSize - nameWithType: Decoder.GetMaxHeaderTableSize -- uid: Titanium.Web.Proxy.Http2.Hpack.Decoder.SetMaxHeaderTableSize(System.Int32) - name: SetMaxHeaderTableSize(Int32) - href: api/Titanium.Web.Proxy.Http2.Hpack.Decoder.html#Titanium_Web_Proxy_Http2_Hpack_Decoder_SetMaxHeaderTableSize_System_Int32_ - commentId: M:Titanium.Web.Proxy.Http2.Hpack.Decoder.SetMaxHeaderTableSize(System.Int32) - fullName: Titanium.Web.Proxy.Http2.Hpack.Decoder.SetMaxHeaderTableSize(System.Int32) - nameWithType: Decoder.SetMaxHeaderTableSize(Int32) -- uid: Titanium.Web.Proxy.Http2.Hpack.Decoder.SetMaxHeaderTableSize* - name: SetMaxHeaderTableSize - href: api/Titanium.Web.Proxy.Http2.Hpack.Decoder.html#Titanium_Web_Proxy_Http2_Hpack_Decoder_SetMaxHeaderTableSize_ - commentId: Overload:Titanium.Web.Proxy.Http2.Hpack.Decoder.SetMaxHeaderTableSize - isSpec: "True" - fullName: Titanium.Web.Proxy.Http2.Hpack.Decoder.SetMaxHeaderTableSize - nameWithType: Decoder.SetMaxHeaderTableSize - uid: Titanium.Web.Proxy.Http2.Hpack.DynamicTable name: DynamicTable href: api/Titanium.Web.Proxy.Http2.Hpack.DynamicTable.html @@ -2244,64 +2299,6 @@ references: isSpec: "True" fullName: Titanium.Web.Proxy.Http2.Hpack.DynamicTable.Size nameWithType: DynamicTable.Size -- uid: Titanium.Web.Proxy.Http2.Hpack.Encoder - name: Encoder - href: api/Titanium.Web.Proxy.Http2.Hpack.Encoder.html - commentId: T:Titanium.Web.Proxy.Http2.Hpack.Encoder - fullName: Titanium.Web.Proxy.Http2.Hpack.Encoder - nameWithType: Encoder -- uid: Titanium.Web.Proxy.Http2.Hpack.Encoder.#ctor(System.Int32) - name: Encoder(Int32) - href: api/Titanium.Web.Proxy.Http2.Hpack.Encoder.html#Titanium_Web_Proxy_Http2_Hpack_Encoder__ctor_System_Int32_ - commentId: M:Titanium.Web.Proxy.Http2.Hpack.Encoder.#ctor(System.Int32) - fullName: Titanium.Web.Proxy.Http2.Hpack.Encoder.Encoder(System.Int32) - nameWithType: Encoder.Encoder(Int32) -- uid: Titanium.Web.Proxy.Http2.Hpack.Encoder.#ctor* - name: Encoder - href: api/Titanium.Web.Proxy.Http2.Hpack.Encoder.html#Titanium_Web_Proxy_Http2_Hpack_Encoder__ctor_ - commentId: Overload:Titanium.Web.Proxy.Http2.Hpack.Encoder.#ctor - isSpec: "True" - fullName: Titanium.Web.Proxy.Http2.Hpack.Encoder.Encoder - nameWithType: Encoder.Encoder -- uid: Titanium.Web.Proxy.Http2.Hpack.Encoder.EncodeHeader(System.IO.BinaryWriter,System.String,System.String,System.Boolean,Titanium.Web.Proxy.Http2.Hpack.HpackUtil.IndexType,System.Boolean) - name: EncodeHeader(BinaryWriter, String, String, Boolean, HpackUtil.IndexType, Boolean) - href: api/Titanium.Web.Proxy.Http2.Hpack.Encoder.html#Titanium_Web_Proxy_Http2_Hpack_Encoder_EncodeHeader_System_IO_BinaryWriter_System_String_System_String_System_Boolean_Titanium_Web_Proxy_Http2_Hpack_HpackUtil_IndexType_System_Boolean_ - commentId: M:Titanium.Web.Proxy.Http2.Hpack.Encoder.EncodeHeader(System.IO.BinaryWriter,System.String,System.String,System.Boolean,Titanium.Web.Proxy.Http2.Hpack.HpackUtil.IndexType,System.Boolean) - fullName: Titanium.Web.Proxy.Http2.Hpack.Encoder.EncodeHeader(System.IO.BinaryWriter, System.String, System.String, System.Boolean, Titanium.Web.Proxy.Http2.Hpack.HpackUtil.IndexType, System.Boolean) - nameWithType: Encoder.EncodeHeader(BinaryWriter, String, String, Boolean, HpackUtil.IndexType, Boolean) -- uid: Titanium.Web.Proxy.Http2.Hpack.Encoder.EncodeHeader* - name: EncodeHeader - href: api/Titanium.Web.Proxy.Http2.Hpack.Encoder.html#Titanium_Web_Proxy_Http2_Hpack_Encoder_EncodeHeader_ - commentId: Overload:Titanium.Web.Proxy.Http2.Hpack.Encoder.EncodeHeader - isSpec: "True" - fullName: Titanium.Web.Proxy.Http2.Hpack.Encoder.EncodeHeader - nameWithType: Encoder.EncodeHeader -- uid: Titanium.Web.Proxy.Http2.Hpack.Encoder.MaxHeaderTableSize - name: MaxHeaderTableSize - href: api/Titanium.Web.Proxy.Http2.Hpack.Encoder.html#Titanium_Web_Proxy_Http2_Hpack_Encoder_MaxHeaderTableSize - commentId: P:Titanium.Web.Proxy.Http2.Hpack.Encoder.MaxHeaderTableSize - fullName: Titanium.Web.Proxy.Http2.Hpack.Encoder.MaxHeaderTableSize - nameWithType: Encoder.MaxHeaderTableSize -- uid: Titanium.Web.Proxy.Http2.Hpack.Encoder.MaxHeaderTableSize* - name: MaxHeaderTableSize - href: api/Titanium.Web.Proxy.Http2.Hpack.Encoder.html#Titanium_Web_Proxy_Http2_Hpack_Encoder_MaxHeaderTableSize_ - commentId: Overload:Titanium.Web.Proxy.Http2.Hpack.Encoder.MaxHeaderTableSize - isSpec: "True" - fullName: Titanium.Web.Proxy.Http2.Hpack.Encoder.MaxHeaderTableSize - nameWithType: Encoder.MaxHeaderTableSize -- uid: Titanium.Web.Proxy.Http2.Hpack.Encoder.SetMaxHeaderTableSize(System.IO.BinaryWriter,System.Int32) - name: SetMaxHeaderTableSize(BinaryWriter, Int32) - href: api/Titanium.Web.Proxy.Http2.Hpack.Encoder.html#Titanium_Web_Proxy_Http2_Hpack_Encoder_SetMaxHeaderTableSize_System_IO_BinaryWriter_System_Int32_ - commentId: M:Titanium.Web.Proxy.Http2.Hpack.Encoder.SetMaxHeaderTableSize(System.IO.BinaryWriter,System.Int32) - fullName: Titanium.Web.Proxy.Http2.Hpack.Encoder.SetMaxHeaderTableSize(System.IO.BinaryWriter, System.Int32) - nameWithType: Encoder.SetMaxHeaderTableSize(BinaryWriter, Int32) -- uid: Titanium.Web.Proxy.Http2.Hpack.Encoder.SetMaxHeaderTableSize* - name: SetMaxHeaderTableSize - href: api/Titanium.Web.Proxy.Http2.Hpack.Encoder.html#Titanium_Web_Proxy_Http2_Hpack_Encoder_SetMaxHeaderTableSize_ - commentId: Overload:Titanium.Web.Proxy.Http2.Hpack.Encoder.SetMaxHeaderTableSize - isSpec: "True" - fullName: Titanium.Web.Proxy.Http2.Hpack.Encoder.SetMaxHeaderTableSize - nameWithType: Encoder.SetMaxHeaderTableSize - uid: Titanium.Web.Proxy.Http2.Hpack.HpackUtil name: HpackUtil href: api/Titanium.Web.Proxy.Http2.Hpack.HpackUtil.html @@ -2378,129 +2375,6 @@ references: commentId: F:Titanium.Web.Proxy.Http2.Hpack.HuffmanDecoder.Instance fullName: Titanium.Web.Proxy.Http2.Hpack.HuffmanDecoder.Instance nameWithType: HuffmanDecoder.Instance -- uid: Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder - name: HuffmanEncoder - href: api/Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.html - commentId: T:Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder - fullName: Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder - nameWithType: HuffmanEncoder -- uid: Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.Encode(System.IO.BinaryWriter,System.Byte[]) - name: Encode(BinaryWriter, Byte[]) - href: api/Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.html#Titanium_Web_Proxy_Http2_Hpack_HuffmanEncoder_Encode_System_IO_BinaryWriter_System_Byte___ - commentId: M:Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.Encode(System.IO.BinaryWriter,System.Byte[]) - name.vb: Encode(BinaryWriter, Byte()) - fullName: Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.Encode(System.IO.BinaryWriter, System.Byte[]) - fullName.vb: Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.Encode(System.IO.BinaryWriter, System.Byte()) - nameWithType: HuffmanEncoder.Encode(BinaryWriter, Byte[]) - nameWithType.vb: HuffmanEncoder.Encode(BinaryWriter, Byte()) -- uid: Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.Encode(System.IO.BinaryWriter,System.Byte[],System.Int32,System.Int32) - name: Encode(BinaryWriter, Byte[], Int32, Int32) - href: api/Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.html#Titanium_Web_Proxy_Http2_Hpack_HuffmanEncoder_Encode_System_IO_BinaryWriter_System_Byte___System_Int32_System_Int32_ - commentId: M:Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.Encode(System.IO.BinaryWriter,System.Byte[],System.Int32,System.Int32) - name.vb: Encode(BinaryWriter, Byte(), Int32, Int32) - fullName: Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.Encode(System.IO.BinaryWriter, System.Byte[], System.Int32, System.Int32) - fullName.vb: Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.Encode(System.IO.BinaryWriter, System.Byte(), System.Int32, System.Int32) - nameWithType: HuffmanEncoder.Encode(BinaryWriter, Byte[], Int32, Int32) - nameWithType.vb: HuffmanEncoder.Encode(BinaryWriter, Byte(), Int32, Int32) -- uid: Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.Encode* - name: Encode - href: api/Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.html#Titanium_Web_Proxy_Http2_Hpack_HuffmanEncoder_Encode_ - commentId: Overload:Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.Encode - isSpec: "True" - fullName: Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.Encode - nameWithType: HuffmanEncoder.Encode -- uid: Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.GetEncodedLength(System.Byte[]) - name: GetEncodedLength(Byte[]) - href: api/Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.html#Titanium_Web_Proxy_Http2_Hpack_HuffmanEncoder_GetEncodedLength_System_Byte___ - commentId: M:Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.GetEncodedLength(System.Byte[]) - name.vb: GetEncodedLength(Byte()) - fullName: Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.GetEncodedLength(System.Byte[]) - fullName.vb: Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.GetEncodedLength(System.Byte()) - nameWithType: HuffmanEncoder.GetEncodedLength(Byte[]) - nameWithType.vb: HuffmanEncoder.GetEncodedLength(Byte()) -- uid: Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.GetEncodedLength* - name: GetEncodedLength - href: api/Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.html#Titanium_Web_Proxy_Http2_Hpack_HuffmanEncoder_GetEncodedLength_ - commentId: Overload:Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.GetEncodedLength - isSpec: "True" - fullName: Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.GetEncodedLength - nameWithType: HuffmanEncoder.GetEncodedLength -- uid: Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.Instance - name: Instance - href: api/Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.html#Titanium_Web_Proxy_Http2_Hpack_HuffmanEncoder_Instance - commentId: F:Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.Instance - fullName: Titanium.Web.Proxy.Http2.Hpack.HuffmanEncoder.Instance - nameWithType: HuffmanEncoder.Instance -- uid: Titanium.Web.Proxy.Http2.Hpack.IHeaderListener - name: IHeaderListener - href: api/Titanium.Web.Proxy.Http2.Hpack.IHeaderListener.html - commentId: T:Titanium.Web.Proxy.Http2.Hpack.IHeaderListener - fullName: Titanium.Web.Proxy.Http2.Hpack.IHeaderListener - nameWithType: IHeaderListener -- uid: Titanium.Web.Proxy.Http2.Hpack.IHeaderListener.AddHeader(System.String,System.String,System.Boolean) - name: AddHeader(String, String, Boolean) - href: api/Titanium.Web.Proxy.Http2.Hpack.IHeaderListener.html#Titanium_Web_Proxy_Http2_Hpack_IHeaderListener_AddHeader_System_String_System_String_System_Boolean_ - commentId: M:Titanium.Web.Proxy.Http2.Hpack.IHeaderListener.AddHeader(System.String,System.String,System.Boolean) - fullName: Titanium.Web.Proxy.Http2.Hpack.IHeaderListener.AddHeader(System.String, System.String, System.Boolean) - nameWithType: IHeaderListener.AddHeader(String, String, Boolean) -- uid: Titanium.Web.Proxy.Http2.Hpack.IHeaderListener.AddHeader* - name: AddHeader - href: api/Titanium.Web.Proxy.Http2.Hpack.IHeaderListener.html#Titanium_Web_Proxy_Http2_Hpack_IHeaderListener_AddHeader_ - commentId: Overload:Titanium.Web.Proxy.Http2.Hpack.IHeaderListener.AddHeader - isSpec: "True" - fullName: Titanium.Web.Proxy.Http2.Hpack.IHeaderListener.AddHeader - nameWithType: IHeaderListener.AddHeader -- uid: Titanium.Web.Proxy.Http2.Hpack.StaticTable - name: StaticTable - href: api/Titanium.Web.Proxy.Http2.Hpack.StaticTable.html - commentId: T:Titanium.Web.Proxy.Http2.Hpack.StaticTable - fullName: Titanium.Web.Proxy.Http2.Hpack.StaticTable - nameWithType: StaticTable -- uid: Titanium.Web.Proxy.Http2.Hpack.StaticTable.Get(System.Int32) - name: Get(Int32) - href: api/Titanium.Web.Proxy.Http2.Hpack.StaticTable.html#Titanium_Web_Proxy_Http2_Hpack_StaticTable_Get_System_Int32_ - commentId: M:Titanium.Web.Proxy.Http2.Hpack.StaticTable.Get(System.Int32) - fullName: Titanium.Web.Proxy.Http2.Hpack.StaticTable.Get(System.Int32) - nameWithType: StaticTable.Get(Int32) -- uid: Titanium.Web.Proxy.Http2.Hpack.StaticTable.Get* - name: Get - href: api/Titanium.Web.Proxy.Http2.Hpack.StaticTable.html#Titanium_Web_Proxy_Http2_Hpack_StaticTable_Get_ - commentId: Overload:Titanium.Web.Proxy.Http2.Hpack.StaticTable.Get - isSpec: "True" - fullName: Titanium.Web.Proxy.Http2.Hpack.StaticTable.Get - nameWithType: StaticTable.Get -- uid: Titanium.Web.Proxy.Http2.Hpack.StaticTable.GetIndex(System.String) - name: GetIndex(String) - href: api/Titanium.Web.Proxy.Http2.Hpack.StaticTable.html#Titanium_Web_Proxy_Http2_Hpack_StaticTable_GetIndex_System_String_ - commentId: M:Titanium.Web.Proxy.Http2.Hpack.StaticTable.GetIndex(System.String) - fullName: Titanium.Web.Proxy.Http2.Hpack.StaticTable.GetIndex(System.String) - nameWithType: StaticTable.GetIndex(String) -- uid: Titanium.Web.Proxy.Http2.Hpack.StaticTable.GetIndex(System.String,System.String) - name: GetIndex(String, String) - href: api/Titanium.Web.Proxy.Http2.Hpack.StaticTable.html#Titanium_Web_Proxy_Http2_Hpack_StaticTable_GetIndex_System_String_System_String_ - commentId: M:Titanium.Web.Proxy.Http2.Hpack.StaticTable.GetIndex(System.String,System.String) - fullName: Titanium.Web.Proxy.Http2.Hpack.StaticTable.GetIndex(System.String, System.String) - nameWithType: StaticTable.GetIndex(String, String) -- uid: Titanium.Web.Proxy.Http2.Hpack.StaticTable.GetIndex* - name: GetIndex - href: api/Titanium.Web.Proxy.Http2.Hpack.StaticTable.html#Titanium_Web_Proxy_Http2_Hpack_StaticTable_GetIndex_ - commentId: Overload:Titanium.Web.Proxy.Http2.Hpack.StaticTable.GetIndex - isSpec: "True" - fullName: Titanium.Web.Proxy.Http2.Hpack.StaticTable.GetIndex - nameWithType: StaticTable.GetIndex -- uid: Titanium.Web.Proxy.Http2.Hpack.StaticTable.Length - name: Length - href: api/Titanium.Web.Proxy.Http2.Hpack.StaticTable.html#Titanium_Web_Proxy_Http2_Hpack_StaticTable_Length - commentId: P:Titanium.Web.Proxy.Http2.Hpack.StaticTable.Length - fullName: Titanium.Web.Proxy.Http2.Hpack.StaticTable.Length - nameWithType: StaticTable.Length -- uid: Titanium.Web.Proxy.Http2.Hpack.StaticTable.Length* - name: Length - href: api/Titanium.Web.Proxy.Http2.Hpack.StaticTable.html#Titanium_Web_Proxy_Http2_Hpack_StaticTable_Length_ - commentId: Overload:Titanium.Web.Proxy.Http2.Hpack.StaticTable.Length - isSpec: "True" - fullName: Titanium.Web.Proxy.Http2.Hpack.StaticTable.Length - nameWithType: StaticTable.Length - uid: Titanium.Web.Proxy.Models name: Titanium.Web.Proxy.Models href: api/Titanium.Web.Proxy.Models.html @@ -2544,6 +2418,31 @@ references: commentId: T:Titanium.Web.Proxy.Models.ExternalProxy fullName: Titanium.Web.Proxy.Models.ExternalProxy nameWithType: ExternalProxy +- uid: Titanium.Web.Proxy.Models.ExternalProxy.#ctor + name: ExternalProxy() + href: api/Titanium.Web.Proxy.Models.ExternalProxy.html#Titanium_Web_Proxy_Models_ExternalProxy__ctor + commentId: M:Titanium.Web.Proxy.Models.ExternalProxy.#ctor + fullName: Titanium.Web.Proxy.Models.ExternalProxy.ExternalProxy() + nameWithType: ExternalProxy.ExternalProxy() +- uid: Titanium.Web.Proxy.Models.ExternalProxy.#ctor(System.String,System.Int32) + name: ExternalProxy(String, Int32) + href: api/Titanium.Web.Proxy.Models.ExternalProxy.html#Titanium_Web_Proxy_Models_ExternalProxy__ctor_System_String_System_Int32_ + commentId: M:Titanium.Web.Proxy.Models.ExternalProxy.#ctor(System.String,System.Int32) + fullName: Titanium.Web.Proxy.Models.ExternalProxy.ExternalProxy(System.String, System.Int32) + nameWithType: ExternalProxy.ExternalProxy(String, Int32) +- uid: Titanium.Web.Proxy.Models.ExternalProxy.#ctor(System.String,System.Int32,System.String,System.String) + name: ExternalProxy(String, Int32, String, String) + href: api/Titanium.Web.Proxy.Models.ExternalProxy.html#Titanium_Web_Proxy_Models_ExternalProxy__ctor_System_String_System_Int32_System_String_System_String_ + commentId: M:Titanium.Web.Proxy.Models.ExternalProxy.#ctor(System.String,System.Int32,System.String,System.String) + fullName: Titanium.Web.Proxy.Models.ExternalProxy.ExternalProxy(System.String, System.Int32, System.String, System.String) + nameWithType: ExternalProxy.ExternalProxy(String, Int32, String, String) +- uid: Titanium.Web.Proxy.Models.ExternalProxy.#ctor* + name: ExternalProxy + href: api/Titanium.Web.Proxy.Models.ExternalProxy.html#Titanium_Web_Proxy_Models_ExternalProxy__ctor_ + commentId: Overload:Titanium.Web.Proxy.Models.ExternalProxy.#ctor + isSpec: "True" + fullName: Titanium.Web.Proxy.Models.ExternalProxy.ExternalProxy + nameWithType: ExternalProxy.ExternalProxy - uid: Titanium.Web.Proxy.Models.ExternalProxy.BypassLocalhost name: BypassLocalhost href: api/Titanium.Web.Proxy.Models.ExternalProxy.html#Titanium_Web_Proxy_Models_ExternalProxy_BypassLocalhost @@ -2596,6 +2495,19 @@ references: isSpec: "True" fullName: Titanium.Web.Proxy.Models.ExternalProxy.Port nameWithType: ExternalProxy.Port +- uid: Titanium.Web.Proxy.Models.ExternalProxy.ProxyType + name: ProxyType + href: api/Titanium.Web.Proxy.Models.ExternalProxy.html#Titanium_Web_Proxy_Models_ExternalProxy_ProxyType + commentId: P:Titanium.Web.Proxy.Models.ExternalProxy.ProxyType + fullName: Titanium.Web.Proxy.Models.ExternalProxy.ProxyType + nameWithType: ExternalProxy.ProxyType +- uid: Titanium.Web.Proxy.Models.ExternalProxy.ProxyType* + name: ProxyType + href: api/Titanium.Web.Proxy.Models.ExternalProxy.html#Titanium_Web_Proxy_Models_ExternalProxy_ProxyType_ + commentId: Overload:Titanium.Web.Proxy.Models.ExternalProxy.ProxyType + isSpec: "True" + fullName: Titanium.Web.Proxy.Models.ExternalProxy.ProxyType + nameWithType: ExternalProxy.ProxyType - uid: Titanium.Web.Proxy.Models.ExternalProxy.ToString name: ToString() href: api/Titanium.Web.Proxy.Models.ExternalProxy.html#Titanium_Web_Proxy_Models_ExternalProxy_ToString @@ -2635,6 +2547,30 @@ references: isSpec: "True" fullName: Titanium.Web.Proxy.Models.ExternalProxy.UserName nameWithType: ExternalProxy.UserName +- uid: Titanium.Web.Proxy.Models.ExternalProxyType + name: ExternalProxyType + href: api/Titanium.Web.Proxy.Models.ExternalProxyType.html + commentId: T:Titanium.Web.Proxy.Models.ExternalProxyType + fullName: Titanium.Web.Proxy.Models.ExternalProxyType + nameWithType: ExternalProxyType +- uid: Titanium.Web.Proxy.Models.ExternalProxyType.Http + name: Http + href: api/Titanium.Web.Proxy.Models.ExternalProxyType.html#Titanium_Web_Proxy_Models_ExternalProxyType_Http + commentId: F:Titanium.Web.Proxy.Models.ExternalProxyType.Http + fullName: Titanium.Web.Proxy.Models.ExternalProxyType.Http + nameWithType: ExternalProxyType.Http +- uid: Titanium.Web.Proxy.Models.ExternalProxyType.Socks4 + name: Socks4 + href: api/Titanium.Web.Proxy.Models.ExternalProxyType.html#Titanium_Web_Proxy_Models_ExternalProxyType_Socks4 + commentId: F:Titanium.Web.Proxy.Models.ExternalProxyType.Socks4 + fullName: Titanium.Web.Proxy.Models.ExternalProxyType.Socks4 + nameWithType: ExternalProxyType.Socks4 +- uid: Titanium.Web.Proxy.Models.ExternalProxyType.Socks5 + name: Socks5 + href: api/Titanium.Web.Proxy.Models.ExternalProxyType.html#Titanium_Web_Proxy_Models_ExternalProxyType_Socks5 + commentId: F:Titanium.Web.Proxy.Models.ExternalProxyType.Socks5 + fullName: Titanium.Web.Proxy.Models.ExternalProxyType.Socks5 + nameWithType: ExternalProxyType.Socks5 - uid: Titanium.Web.Proxy.Models.HttpHeader name: HttpHeader href: api/Titanium.Web.Proxy.Models.HttpHeader.html @@ -2647,12 +2583,6 @@ references: commentId: M:Titanium.Web.Proxy.Models.HttpHeader.#ctor(System.String,System.String) fullName: Titanium.Web.Proxy.Models.HttpHeader.HttpHeader(System.String, System.String) nameWithType: HttpHeader.HttpHeader(String, String) -- uid: Titanium.Web.Proxy.Models.HttpHeader.#ctor(System.String,System.String,System.Boolean) - name: HttpHeader(String, String, Boolean) - href: api/Titanium.Web.Proxy.Models.HttpHeader.html#Titanium_Web_Proxy_Models_HttpHeader__ctor_System_String_System_String_System_Boolean_ - commentId: M:Titanium.Web.Proxy.Models.HttpHeader.#ctor(System.String,System.String,System.Boolean) - fullName: Titanium.Web.Proxy.Models.HttpHeader.HttpHeader(System.String, System.String, System.Boolean) - nameWithType: HttpHeader.HttpHeader(String, String, Boolean) - uid: Titanium.Web.Proxy.Models.HttpHeader.#ctor* name: HttpHeader href: api/Titanium.Web.Proxy.Models.HttpHeader.html#Titanium_Web_Proxy_Models_HttpHeader__ctor_ @@ -2660,6 +2590,19 @@ references: isSpec: "True" fullName: Titanium.Web.Proxy.Models.HttpHeader.HttpHeader nameWithType: HttpHeader.HttpHeader +- uid: Titanium.Web.Proxy.Models.HttpHeader.Encoding + name: Encoding + href: api/Titanium.Web.Proxy.Models.HttpHeader.html#Titanium_Web_Proxy_Models_HttpHeader_Encoding + commentId: P:Titanium.Web.Proxy.Models.HttpHeader.Encoding + fullName: Titanium.Web.Proxy.Models.HttpHeader.Encoding + nameWithType: HttpHeader.Encoding +- uid: Titanium.Web.Proxy.Models.HttpHeader.Encoding* + name: Encoding + href: api/Titanium.Web.Proxy.Models.HttpHeader.html#Titanium_Web_Proxy_Models_HttpHeader_Encoding_ + commentId: Overload:Titanium.Web.Proxy.Models.HttpHeader.Encoding + isSpec: "True" + fullName: Titanium.Web.Proxy.Models.HttpHeader.Encoding + nameWithType: HttpHeader.Encoding - uid: Titanium.Web.Proxy.Models.HttpHeader.HttpHeaderOverhead name: HttpHeaderOverhead href: api/Titanium.Web.Proxy.Models.HttpHeader.html#Titanium_Web_Proxy_Models_HttpHeader_HttpHeaderOverhead @@ -2692,19 +2635,6 @@ references: isSpec: "True" fullName: Titanium.Web.Proxy.Models.HttpHeader.Size nameWithType: HttpHeader.Size -- uid: Titanium.Web.Proxy.Models.HttpHeader.SizeOf(System.String,System.String) - name: SizeOf(String, String) - href: api/Titanium.Web.Proxy.Models.HttpHeader.html#Titanium_Web_Proxy_Models_HttpHeader_SizeOf_System_String_System_String_ - commentId: M:Titanium.Web.Proxy.Models.HttpHeader.SizeOf(System.String,System.String) - fullName: Titanium.Web.Proxy.Models.HttpHeader.SizeOf(System.String, System.String) - nameWithType: HttpHeader.SizeOf(String, String) -- uid: Titanium.Web.Proxy.Models.HttpHeader.SizeOf* - name: SizeOf - href: api/Titanium.Web.Proxy.Models.HttpHeader.html#Titanium_Web_Proxy_Models_HttpHeader_SizeOf_ - commentId: Overload:Titanium.Web.Proxy.Models.HttpHeader.SizeOf - isSpec: "True" - fullName: Titanium.Web.Proxy.Models.HttpHeader.SizeOf - nameWithType: HttpHeader.SizeOf - uid: Titanium.Web.Proxy.Models.HttpHeader.ToString name: ToString() href: api/Titanium.Web.Proxy.Models.HttpHeader.html#Titanium_Web_Proxy_Models_HttpHeader_ToString @@ -3426,6 +3356,32 @@ references: isSpec: "True" fullName: Titanium.Web.Proxy.ProxyServer.ConnectionTimeOutSeconds nameWithType: ProxyServer.ConnectionTimeOutSeconds +- uid: Titanium.Web.Proxy.ProxyServer.ConnectTimeOutSeconds + name: ConnectTimeOutSeconds + href: api/Titanium.Web.Proxy.ProxyServer.html#Titanium_Web_Proxy_ProxyServer_ConnectTimeOutSeconds + commentId: P:Titanium.Web.Proxy.ProxyServer.ConnectTimeOutSeconds + fullName: Titanium.Web.Proxy.ProxyServer.ConnectTimeOutSeconds + nameWithType: ProxyServer.ConnectTimeOutSeconds +- uid: Titanium.Web.Proxy.ProxyServer.ConnectTimeOutSeconds* + name: ConnectTimeOutSeconds + href: api/Titanium.Web.Proxy.ProxyServer.html#Titanium_Web_Proxy_ProxyServer_ConnectTimeOutSeconds_ + commentId: Overload:Titanium.Web.Proxy.ProxyServer.ConnectTimeOutSeconds + isSpec: "True" + fullName: Titanium.Web.Proxy.ProxyServer.ConnectTimeOutSeconds + nameWithType: ProxyServer.ConnectTimeOutSeconds +- uid: Titanium.Web.Proxy.ProxyServer.CustomUpStreamProxyFailureFunc + name: CustomUpStreamProxyFailureFunc + href: api/Titanium.Web.Proxy.ProxyServer.html#Titanium_Web_Proxy_ProxyServer_CustomUpStreamProxyFailureFunc + commentId: P:Titanium.Web.Proxy.ProxyServer.CustomUpStreamProxyFailureFunc + fullName: Titanium.Web.Proxy.ProxyServer.CustomUpStreamProxyFailureFunc + nameWithType: ProxyServer.CustomUpStreamProxyFailureFunc +- uid: Titanium.Web.Proxy.ProxyServer.CustomUpStreamProxyFailureFunc* + name: CustomUpStreamProxyFailureFunc + href: api/Titanium.Web.Proxy.ProxyServer.html#Titanium_Web_Proxy_ProxyServer_CustomUpStreamProxyFailureFunc_ + commentId: Overload:Titanium.Web.Proxy.ProxyServer.CustomUpStreamProxyFailureFunc + isSpec: "True" + fullName: Titanium.Web.Proxy.ProxyServer.CustomUpStreamProxyFailureFunc + nameWithType: ProxyServer.CustomUpStreamProxyFailureFunc - uid: Titanium.Web.Proxy.ProxyServer.DisableAllSystemProxies name: DisableAllSystemProxies() href: api/Titanium.Web.Proxy.ProxyServer.html#Titanium_Web_Proxy_ProxyServer_DisableAllSystemProxies
      AsyncEventHandler<TcpClient>AsyncEventHandler<Socket>