Commit 1639103c authored by Jehonathan Thomas's avatar Jehonathan Thomas

organize files; remove unused usings

parent 33d86a59
...@@ -156,7 +156,11 @@ namespace Titanium.Web.Proxy.Examples.Basic ...@@ -156,7 +156,11 @@ namespace Titanium.Web.Proxy.Examples.Basic
// this is just to show the functionality, provided values are junk // this is just to show the functionality, provided values are junk
return new ExternalProxy return new ExternalProxy
{ {
BypassLocalhost = false, HostName = "127.0.0.9", Port = 9090, Password = "fake", UserName = "fake", BypassLocalhost = false,
HostName = "127.0.0.9",
Port = 9090,
Password = "fake",
UserName = "fake",
UseDefaultCredentials = false UseDefaultCredentials = false
}; };
} }
...@@ -168,7 +172,11 @@ namespace Titanium.Web.Proxy.Examples.Basic ...@@ -168,7 +172,11 @@ namespace Titanium.Web.Proxy.Examples.Basic
// this is just to show the functionality, provided values are junk // this is just to show the functionality, provided values are junk
return new ExternalProxy return new ExternalProxy
{ {
BypassLocalhost = false, HostName = "127.0.0.10", Port = 9191, Password = "fake2", UserName = "fake2", BypassLocalhost = false,
HostName = "127.0.0.10",
Port = 9191,
Password = "fake2",
UserName = "fake2",
UseDefaultCredentials = false UseDefaultCredentials = false
}; };
} }
......
using System; using System.Text;
using System.Text;
namespace Titanium.Web.Proxy.Examples.Basic namespace Titanium.Web.Proxy.Examples.Basic
{ {
......
...@@ -104,7 +104,7 @@ namespace Titanium.Web.Proxy.Examples.Wpf ...@@ -104,7 +104,7 @@ namespace Titanium.Web.Proxy.Examples.Wpf
Dispatcher.Invoke(() => { ServerConnectionCount = proxyServer.ServerConnectionCount; }); Dispatcher.Invoke(() => { ServerConnectionCount = proxyServer.ServerConnectionCount; });
}; };
proxyServer.Start(); proxyServer.Start();
proxyServer.SetAsSystemProxy(explicitEndPoint, ProxyProtocolType.AllHttp); proxyServer.SetAsSystemProxy(explicitEndPoint, ProxyProtocolType.AllHttp);
InitializeComponent(); InitializeComponent();
...@@ -279,7 +279,7 @@ namespace Titanium.Web.Proxy.Examples.Wpf ...@@ -279,7 +279,7 @@ namespace Titanium.Web.Proxy.Examples.Wpf
li.SentDataCount += args.Count; li.SentDataCount += args.Count;
//if (tunnelType == TunnelType.Http2) //if (tunnelType == TunnelType.Http2)
AppendTransferLog( session.GetHashCode() + (isTunnelConnect ? "_tunnel" : "") + "_sent", AppendTransferLog(session.GetHashCode() + (isTunnelConnect ? "_tunnel" : "") + "_sent",
args.Buffer, args.Offset, args.Count); args.Buffer, args.Offset, args.Count);
} }
}; };
......
...@@ -162,7 +162,7 @@ namespace Titanium.Web.Proxy.Network.Certificate ...@@ -162,7 +162,7 @@ namespace Titanium.Web.Proxy.Network.Certificate
const string password = "password"; const string password = "password";
Pkcs12Store store; Pkcs12Store store;
if(RunTime.IsRunningOnMono) if (RunTime.IsRunningOnMono)
{ {
var builder = new Pkcs12StoreBuilder(); var builder = new Pkcs12StoreBuilder();
builder.SetUseDerEncoding(true); builder.SetUseDerEncoding(true);
...@@ -172,7 +172,7 @@ namespace Titanium.Web.Proxy.Network.Certificate ...@@ -172,7 +172,7 @@ namespace Titanium.Web.Proxy.Network.Certificate
{ {
store = new Pkcs12Store(); store = new Pkcs12Store();
} }
var entry = new X509CertificateEntry(certificate); var entry = new X509CertificateEntry(certificate);
store.SetCertificateEntry(certificate.SubjectDN.ToString(), entry); store.SetCertificateEntry(certificate.SubjectDN.ToString(), entry);
......
...@@ -171,7 +171,7 @@ namespace Titanium.Web.Proxy.Network.Certificate ...@@ -171,7 +171,7 @@ namespace Titanium.Web.Proxy.Network.Certificate
const string password = "password"; const string password = "password";
Pkcs12Store store; Pkcs12Store store;
if(RunTime.IsRunningOnMono) if (RunTime.IsRunningOnMono)
{ {
var builder = new Pkcs12StoreBuilder(); var builder = new Pkcs12StoreBuilder();
builder.SetUseDerEncoding(true); builder.SetUseDerEncoding(true);
...@@ -181,7 +181,7 @@ namespace Titanium.Web.Proxy.Network.Certificate ...@@ -181,7 +181,7 @@ namespace Titanium.Web.Proxy.Network.Certificate
{ {
store = new Pkcs12Store(); store = new Pkcs12Store();
} }
var entry = new X509CertificateEntry(certificate); var entry = new X509CertificateEntry(certificate);
store.SetCertificateEntry(certificate.SubjectDN.ToString(), entry); store.SetCertificateEntry(certificate.SubjectDN.ToString(), entry);
......
...@@ -12,7 +12,7 @@ namespace Titanium.Web.Proxy.Network ...@@ -12,7 +12,7 @@ namespace Titanium.Web.Proxy.Network
{ {
Certificate = certificate; Certificate = certificate;
} }
internal X509Certificate2 Certificate { get; } internal X509Certificate2 Certificate { get; }
/// <summary> /// <summary>
......
...@@ -25,7 +25,7 @@ namespace Titanium.Web.Proxy.Network ...@@ -25,7 +25,7 @@ namespace Titanium.Web.Proxy.Network
BouncyCastle = 0, BouncyCastle = 0,
BouncyCastleFast = 2, BouncyCastleFast = 2,
/// <summary> /// <summary>
/// Uses Windows Certification Generation API and only valid in Windows OS. /// Uses Windows Certification Generation API and only valid in Windows OS.
/// Observed to be faster than BouncyCastle. /// Observed to be faster than BouncyCastle.
......
using System; using Titanium.Web.Proxy.Http;
using Titanium.Web.Proxy.Http;
namespace Titanium.Web.Proxy.Compression namespace Titanium.Web.Proxy.Compression
{ {
......
using System; namespace Titanium.Web.Proxy.Compression
namespace Titanium.Web.Proxy.Compression
{ {
internal enum HttpCompression internal enum HttpCompression
{ {
......
using System; using System.Threading;
using System.Threading;
using Titanium.Web.Proxy.Network.Tcp; using Titanium.Web.Proxy.Network.Tcp;
namespace Titanium.Web.Proxy.EventArguments namespace Titanium.Web.Proxy.EventArguments
......
using System; using System.Security.Cryptography.X509Certificates;
using System.Security.Cryptography.X509Certificates;
namespace Titanium.Web.Proxy.EventArguments namespace Titanium.Web.Proxy.EventArguments
{ {
......
using System; using System.Net.Security;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
namespace Titanium.Web.Proxy.EventArguments namespace Titanium.Web.Proxy.EventArguments
......
using System; using Titanium.Web.Proxy.Network.Tcp;
using Titanium.Web.Proxy.Network.Tcp;
namespace Titanium.Web.Proxy.EventArguments namespace Titanium.Web.Proxy.EventArguments
{ {
......
...@@ -20,7 +20,7 @@ namespace Titanium.Web.Proxy.EventArguments ...@@ -20,7 +20,7 @@ namespace Titanium.Web.Proxy.EventArguments
internal LimitedStream(IHttpStreamReader baseStream, IBufferPool bufferPool, bool isChunked, internal LimitedStream(IHttpStreamReader baseStream, IBufferPool bufferPool, bool isChunked,
long contentLength) long contentLength)
{ {
this.baseReader = baseStream; this.baseReader = baseStream;
this.bufferPool = bufferPool; this.bufferPool = bufferPool;
this.isChunked = isChunked; this.isChunked = isChunked;
......
...@@ -59,7 +59,7 @@ namespace Titanium.Web.Proxy.EventArguments ...@@ -59,7 +59,7 @@ namespace Titanium.Web.Proxy.EventArguments
} }
} }
public WebSocketDecoder WebSocketDecoder => webSocketDecoder ??= new WebSocketDecoder(BufferPool); public WebSocketDecoder WebSocketDecoder => webSocketDecoder ??= new WebSocketDecoder(BufferPool);
/// <summary> /// <summary>
/// Occurs when multipart request part sent. /// Occurs when multipart request part sent.
...@@ -588,7 +588,7 @@ namespace Titanium.Web.Proxy.EventArguments ...@@ -588,7 +588,7 @@ namespace Titanium.Web.Proxy.EventArguments
{ {
HttpClient.Request.Locked = true; HttpClient.Request.Locked = true;
HttpClient.Request.CancelRequest = true; HttpClient.Request.CancelRequest = true;
// set new response. // set new response.
HttpClient.Response = response; HttpClient.Response = response;
HttpClient.Response.Locked = true; HttpClient.Response.Locked = true;
......
...@@ -62,7 +62,7 @@ namespace Titanium.Web.Proxy.Extensions ...@@ -62,7 +62,7 @@ namespace Titanium.Web.Proxy.Extensions
} }
} }
internal static async Task<T> WithCancellation<T>(this Task<T> task, CancellationToken cancellationToken) where T : struct internal static async Task<T> WithCancellation<T>(this Task<T> task, CancellationToken cancellationToken) where T : struct
{ {
var tcs = new TaskCompletionSource<bool>(); var tcs = new TaskCompletionSource<bool>();
using (cancellationToken.Register(s => ((TaskCompletionSource<bool>)s).TrySetResult(true), tcs)) using (cancellationToken.Register(s => ((TaskCompletionSource<bool>)s).TrySetResult(true), tcs))
......
using System; using System.Net.Sockets;
using System.Net.Sockets;
namespace Titanium.Web.Proxy.Extensions namespace Titanium.Web.Proxy.Extensions
{ {
......
using System; using System.IO;
using System.IO;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Titanium.Web.Proxy.Http; using Titanium.Web.Proxy.Http;
...@@ -12,7 +11,7 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -12,7 +11,7 @@ namespace Titanium.Web.Proxy.Helpers
{ {
public TcpClientConnection Connection { get; } public TcpClientConnection Connection { get; }
internal HttpClientStream(TcpClientConnection connection, Stream stream, IBufferPool bufferPool, CancellationToken cancellationToken) internal HttpClientStream(TcpClientConnection connection, Stream stream, IBufferPool bufferPool, CancellationToken cancellationToken)
: base(stream, bufferPool, cancellationToken) : base(stream, bufferPool, cancellationToken)
{ {
Connection = connection; Connection = connection;
...@@ -27,10 +26,10 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -27,10 +26,10 @@ namespace Titanium.Web.Proxy.Helpers
internal async ValueTask WriteResponseAsync(Response response, CancellationToken cancellationToken = default) internal async ValueTask WriteResponseAsync(Response response, CancellationToken cancellationToken = default)
{ {
var headerBuilder = new HeaderBuilder(); var headerBuilder = new HeaderBuilder();
// Write back response status to client // Write back response status to client
headerBuilder.WriteResponseLine(response.HttpVersion, response.StatusCode, response.StatusDescription); headerBuilder.WriteResponseLine(response.HttpVersion, response.StatusCode, response.StatusDescription);
await WriteAsync(response, headerBuilder, cancellationToken); await WriteAsync(response, headerBuilder, cancellationToken);
} }
......
...@@ -1017,7 +1017,7 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -1017,7 +1017,7 @@ namespace Titanium.Web.Proxy.Helpers
string? contentEncoding = useOriginalHeaderValues ? requestResponse.OriginalContentEncoding : requestResponse.ContentEncoding; string? contentEncoding = useOriginalHeaderValues ? requestResponse.OriginalContentEncoding : requestResponse.ContentEncoding;
Stream s = limitedStream = new LimitedStream(this, bufferPool, isChunked, contentLength); Stream s = limitedStream = new LimitedStream(this, bufferPool, isChunked, contentLength);
if (transformation == TransformationMode.Uncompress && contentEncoding != null) if (transformation == TransformationMode.Uncompress && contentEncoding != null)
{ {
s = decompressStream = DecompressionFactory.Create(CompressionUtil.CompressionNameToEnum(contentEncoding), s); s = decompressStream = DecompressionFactory.Create(CompressionUtil.CompressionNameToEnum(contentEncoding), s);
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
// RFC 4437: Web Distributed Authoring and Versioning (WebDAV): Redirect Reference Resources // RFC 4437: Web Distributed Authoring and Versioning (WebDAV): Redirect Reference Resources
Mkredirectref, Mkredirectref,
Updateredirectref, Updateredirectref,
// RFC 4791: Calendaring Extensions to WebDAV (CalDAV) // RFC 4791: Calendaring Extensions to WebDAV (CalDAV)
Mkcalendar, Mkcalendar,
......
...@@ -53,7 +53,7 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -53,7 +53,7 @@ namespace Titanium.Web.Proxy.Helpers
} }
try try
{ {
// do reverse DNS lookup even if hostName is an IP address // do reverse DNS lookup even if hostName is an IP address
var hostEntry = Dns.GetHostEntry(hostName); var hostEntry = Dns.GetHostEntry(hostName);
// if DNS resolved hostname matches local DNS name, // if DNS resolved hostname matches local DNS name,
......
...@@ -19,7 +19,7 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -19,7 +19,7 @@ namespace Titanium.Web.Proxy.Helpers
public Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) public Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
{ {
#if NET45 #if NET45
return Net45Compatibility.CompletedTask; return Net45Compatibility.CompletedTask;
#else #else
return Task.CompletedTask; return Task.CompletedTask;
#endif #endif
......
using System; using System;
using System.Reflection; using System.Reflection;
using System.Text;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Runtime.Versioning; using System.Runtime.Versioning;
using System.Text;
namespace Titanium.Web.Proxy.Helpers namespace Titanium.Web.Proxy.Helpers
{ {
...@@ -63,7 +63,7 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -63,7 +63,7 @@ namespace Titanium.Web.Proxy.Helpers
public static bool IsUwpOnWindows => IsWindows && UwpHelper.IsRunningAsUwp(); public static bool IsUwpOnWindows => IsWindows && UwpHelper.IsRunningAsUwp();
public static bool IsMac => isRunningOnMac; public static bool IsMac => isRunningOnMac;
/// <summary> /// <summary>
/// Is socket reuse available to use? /// Is socket reuse available to use?
/// </summary> /// </summary>
......
...@@ -130,7 +130,7 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -130,7 +130,7 @@ namespace Titanium.Web.Proxy.Helpers
/// <param name="cancellationTokenSource"></param> /// <param name="cancellationTokenSource"></param>
/// <param name="exceptionFunc"></param> /// <param name="exceptionFunc"></param>
/// <returns></returns> /// <returns></returns>
internal static Task SendRaw(Stream clientStream, Stream serverStream, IBufferPool bufferPool, internal static Task SendRaw(Stream clientStream, Stream serverStream, IBufferPool bufferPool,
Action<byte[], int, int>? onDataSend, Action<byte[], int, int>? onDataReceive, Action<byte[], int, int>? onDataSend, Action<byte[], int, int>? onDataReceive,
CancellationTokenSource cancellationTokenSource, CancellationTokenSource cancellationTokenSource,
ExceptionHandler exceptionFunc) ExceptionHandler exceptionFunc)
......
using System; using Titanium.Web.Proxy.Models;
using Titanium.Web.Proxy.Models;
using Titanium.Web.Proxy.StreamExtended; using Titanium.Web.Proxy.StreamExtended;
namespace Titanium.Web.Proxy.Http namespace Titanium.Web.Proxy.Http
......
...@@ -145,7 +145,7 @@ namespace Titanium.Web.Proxy.Http ...@@ -145,7 +145,7 @@ namespace Titanium.Web.Proxy.Http
{ {
url = "/"; url = "/";
} }
// prepare the request & headers // prepare the request & headers
var headerBuilder = new HeaderBuilder(); var headerBuilder = new HeaderBuilder();
headerBuilder.WriteRequestLine(Request.Method, url, Request.HttpVersion); headerBuilder.WriteRequestLine(Request.Method, url, Request.HttpVersion);
......
...@@ -210,7 +210,7 @@ namespace Titanium.Web.Proxy.Http ...@@ -210,7 +210,7 @@ namespace Titanium.Web.Proxy.Http
internal bool Locked { get; set; } internal bool Locked { get; set; }
internal bool BodyAvailable => BodyInternal != null; internal bool BodyAvailable => BodyInternal != null;
internal bool IsBodySent { get; set; } internal bool IsBodySent { get; set; }
internal abstract void EnsureBodyAvailable(bool throwWhenNotReadYet = true); internal abstract void EnsureBodyAvailable(bool throwWhenNotReadYet = true);
......
...@@ -103,7 +103,7 @@ namespace Titanium.Web.Proxy.Http2.Hpack ...@@ -103,7 +103,7 @@ namespace Titanium.Web.Proxy.Http2.Hpack
if (headerField != null) if (headerField != null)
{ {
int index = getIndex(headerField.Index) + StaticTable.Length; int index = getIndex(headerField.Index) + StaticTable.Length;
// Section 6.1. Indexed Header Field Representation // Section 6.1. Indexed Header Field Representation
encodeInteger(output, 0x80, 7, index); encodeInteger(output, 0x80, 7, index);
} }
......
...@@ -15,20 +15,19 @@ ...@@ -15,20 +15,19 @@
* limitations under the License. * limitations under the License.
*/ */
using System;
using Titanium.Web.Proxy.Models; using Titanium.Web.Proxy.Models;
namespace Titanium.Web.Proxy.Http2.Hpack namespace Titanium.Web.Proxy.Http2.Hpack
{ {
internal interface IHeaderListener internal interface IHeaderListener
{ {
/// <summary> /// <summary>
/// EmitHeader is called by the decoder during header field emission. /// EmitHeader is called by the decoder during header field emission.
/// The name and value byte arrays must not be modified. /// The name and value byte arrays must not be modified.
/// </summary> /// </summary>
/// <param name="name">Name.</param> /// <param name="name">Name.</param>
/// <param name="value">Value.</param> /// <param name="value">Value.</param>
/// <param name="sensitive">If set to <c>true</c> sensitive.</param> /// <param name="sensitive">If set to <c>true</c> sensitive.</param>
void AddHeader(ByteString name, ByteString value, bool sensitive); void AddHeader(ByteString name, ByteString value, bool sensitive);
} }
} }
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
* limitations under the License. * limitations under the License.
*/ */
using System;
using System.Collections.Generic; using System.Collections.Generic;
using Titanium.Web.Proxy.Models; using Titanium.Web.Proxy.Models;
...@@ -32,7 +31,7 @@ namespace Titanium.Web.Proxy.Http2.Hpack ...@@ -32,7 +31,7 @@ namespace Titanium.Web.Proxy.Http2.Hpack
private static readonly Dictionary<ByteString, int> staticIndexByName; private static readonly Dictionary<ByteString, int> staticIndexByName;
public static ByteString KnownHeaderAuhtority = (ByteString)":authority"; public static ByteString KnownHeaderAuhtority = (ByteString)":authority";
public static ByteString KnownHeaderMethod = (ByteString)":method"; public static ByteString KnownHeaderMethod = (ByteString)":method";
public static ByteString KnownHeaderPath = (ByteString)":path"; public static ByteString KnownHeaderPath = (ByteString)":path";
...@@ -109,11 +108,11 @@ namespace Titanium.Web.Proxy.Http2.Hpack ...@@ -109,11 +108,11 @@ namespace Titanium.Web.Proxy.Http2.Hpack
create("WWW-Authenticate", string.Empty); // 61 create("WWW-Authenticate", string.Empty); // 61
} }
/// <summary> /// <summary>
/// The number of header fields in the static table. /// The number of header fields in the static table.
/// </summary> /// </summary>
/// <value>The length.</value> /// <value>The length.</value>
public static int Length => staticTable.Count; public static int Length => staticTable.Count;
/// <summary> /// <summary>
/// Return the http header field at the given index value. /// Return the http header field at the given index value.
......
...@@ -43,12 +43,12 @@ namespace Titanium.Web.Proxy.Http2 ...@@ -43,12 +43,12 @@ namespace Titanium.Web.Proxy.Http2
// Now async relay all server=>client & client=>server data // Now async relay all server=>client & client=>server data
var sendRelay = var sendRelay =
copyHttp2FrameAsync(clientStream, serverStream, clientSettings, serverSettings, copyHttp2FrameAsync(clientStream, serverStream, clientSettings, serverSettings,
sessionFactory, sessions, onBeforeRequest, sessionFactory, sessions, onBeforeRequest,
connectionId, true, cancellationTokenSource.Token, exceptionFunc); connectionId, true, cancellationTokenSource.Token, exceptionFunc);
var receiveRelay = var receiveRelay =
copyHttp2FrameAsync(serverStream, clientStream, serverSettings, clientSettings, copyHttp2FrameAsync(serverStream, clientStream, serverSettings, clientSettings,
sessionFactory, sessions, onBeforeResponse, sessionFactory, sessions, onBeforeResponse,
connectionId, false, cancellationTokenSource.Token, exceptionFunc); connectionId, false, cancellationTokenSource.Token, exceptionFunc);
await Task.WhenAny(sendRelay, receiveRelay); await Task.WhenAny(sendRelay, receiveRelay);
...@@ -59,7 +59,7 @@ namespace Titanium.Web.Proxy.Http2 ...@@ -59,7 +59,7 @@ namespace Titanium.Web.Proxy.Http2
private static async Task copyHttp2FrameAsync(Stream input, Stream output, private static async Task copyHttp2FrameAsync(Stream input, Stream output,
Http2Settings localSettings, Http2Settings remoteSettings, Http2Settings localSettings, Http2Settings remoteSettings,
Func<SessionEventArgs> sessionFactory, ConcurrentDictionary<int, SessionEventArgs> sessions, Func<SessionEventArgs> sessionFactory, ConcurrentDictionary<int, SessionEventArgs> sessions,
Func<SessionEventArgs, Task> onBeforeRequestResponse, Func<SessionEventArgs, Task> onBeforeRequestResponse,
Guid connectionId, bool isClient, CancellationToken cancellationToken, Guid connectionId, bool isClient, CancellationToken cancellationToken,
ExceptionHandler exceptionFunc) ExceptionHandler exceptionFunc)
...@@ -81,7 +81,7 @@ namespace Titanium.Web.Proxy.Http2 ...@@ -81,7 +81,7 @@ namespace Titanium.Web.Proxy.Http2
int length = (frameHeaderBuffer[0] << 16) + (frameHeaderBuffer[1] << 8) + frameHeaderBuffer[2]; int length = (frameHeaderBuffer[0] << 16) + (frameHeaderBuffer[1] << 8) + frameHeaderBuffer[2];
var type = (Http2FrameType)frameHeaderBuffer[3]; var type = (Http2FrameType)frameHeaderBuffer[3];
var flags = (Http2FrameFlag)frameHeaderBuffer[4]; var flags = (Http2FrameFlag)frameHeaderBuffer[4];
int streamId = ((frameHeaderBuffer[5] & 0x7f) << 24) + (frameHeaderBuffer[6] << 16) + int streamId = ((frameHeaderBuffer[5] & 0x7f) << 24) + (frameHeaderBuffer[6] << 16) +
(frameHeaderBuffer[7] << 8) + frameHeaderBuffer[8]; (frameHeaderBuffer[7] << 8) + frameHeaderBuffer[8];
frameHeader.Length = length; frameHeader.Length = length;
...@@ -129,7 +129,7 @@ namespace Titanium.Web.Proxy.Http2 ...@@ -129,7 +129,7 @@ namespace Titanium.Web.Proxy.Http2
//System.Diagnostics.Debug.WriteLine("CONN: " + connectionId + ", CLIENT: " + isClient + ", STREAM: " + streamId + ", TYPE: " + type); //System.Diagnostics.Debug.WriteLine("CONN: " + connectionId + ", CLIENT: " + isClient + ", STREAM: " + streamId + ", TYPE: " + type);
if (type == Http2FrameType.Data && args != null) if (type == Http2FrameType.Data && args != null)
{ {
if (isClient) if (isClient)
args.OnDataSent(buffer, 0, read); args.OnDataSent(buffer, 0, read);
else else
args.OnDataReceived(buffer, 0, read); args.OnDataReceived(buffer, 0, read);
......
...@@ -85,7 +85,7 @@ namespace Titanium.Web.Proxy.Models ...@@ -85,7 +85,7 @@ namespace Titanium.Web.Proxy.Models
/// <param name="port">The port.</param> /// <param name="port">The port.</param>
public ExternalProxy(string hostName, int port) public ExternalProxy(string hostName, int port)
{ {
HostName = hostName; HostName = hostName;
Port = port; Port = port;
} }
...@@ -115,7 +115,7 @@ namespace Titanium.Web.Proxy.Models ...@@ -115,7 +115,7 @@ namespace Titanium.Web.Proxy.Models
} }
public enum ExternalProxyType public enum ExternalProxyType
{ {
/// <summary>A HTTP/HTTPS proxy server.</summary> /// <summary>A HTTP/HTTPS proxy server.</summary>
Http, Http,
......
...@@ -58,7 +58,7 @@ namespace Titanium.Web.Proxy.Models ...@@ -58,7 +58,7 @@ namespace Titanium.Web.Proxy.Models
nameString = name.Trim(); nameString = name.Trim();
NameData = nameString.GetByteString(); NameData = nameString.GetByteString();
valueString = value.Trim(); valueString = value.Trim();
ValueData = valueString.GetByteString(); ValueData = valueString.GetByteString();
} }
......
using System; using System.Net;
using System.Net;
using System.Threading.Tasks; using System.Threading.Tasks;
using Titanium.Web.Proxy.EventArguments; using Titanium.Web.Proxy.EventArguments;
......
...@@ -45,7 +45,7 @@ namespace Titanium.Web.Proxy.Network ...@@ -45,7 +45,7 @@ namespace Titanium.Web.Proxy.Network
} }
catch (Exception ex) catch (Exception ex)
{ {
exception = ex; exception = ex;
} }
...@@ -59,7 +59,7 @@ namespace Titanium.Web.Proxy.Network ...@@ -59,7 +59,7 @@ namespace Titanium.Web.Proxy.Network
} }
exception = null; exception = null;
await disposeConnection(); await disposeConnection();
} }
return new RetryResult(currentConnection, exception, @continue); return new RetryResult(currentConnection, exception, @continue);
...@@ -80,9 +80,9 @@ namespace Titanium.Web.Proxy.Network ...@@ -80,9 +80,9 @@ namespace Titanium.Web.Proxy.Network
internal class RetryResult internal class RetryResult
{ {
internal TcpServerConnection? LatestConnection { get; } internal TcpServerConnection? LatestConnection { get; }
internal Exception? Exception { get; } internal Exception? Exception { get; }
internal bool Continue { get; } internal bool Continue { get; }
internal RetryResult(TcpServerConnection? lastConnection, Exception? exception, bool @continue) internal RetryResult(TcpServerConnection? lastConnection, Exception? exception, bool @continue)
......
...@@ -85,7 +85,7 @@ namespace Titanium.Web.Proxy.Network.Tcp ...@@ -85,7 +85,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
// This way we can push tcp Time_Wait to client side when possible. // This way we can push tcp Time_Wait to client side when possible.
await Task.Delay(1000); await Task.Delay(1000);
proxyServer.UpdateClientConnectionCount(false); proxyServer.UpdateClientConnectionCount(false);
try try
{ {
tcpClientSocket.Close(); tcpClientSocket.Close();
......
...@@ -59,7 +59,7 @@ namespace Titanium.Web.Proxy.Network.Tcp ...@@ -59,7 +59,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
cacheKeyBuilder.Append("-"); cacheKeyBuilder.Append("-");
cacheKeyBuilder.Append(remotePort); cacheKeyBuilder.Append(remotePort);
cacheKeyBuilder.Append("-"); cacheKeyBuilder.Append("-");
// when creating Tcp client isConnect won't matter // when creating Tcp client isConnect won't matter
cacheKeyBuilder.Append(isHttps); cacheKeyBuilder.Append(isHttps);
...@@ -382,7 +382,7 @@ retry: ...@@ -382,7 +382,7 @@ retry:
proxySocket.ProxyUser = externalProxy.UserName; proxySocket.ProxyUser = externalProxy.UserName;
proxySocket.ProxyPass = externalProxy.Password; proxySocket.ProxyPass = externalProxy.Password;
} }
tcpServerSocket = proxySocket; tcpServerSocket = proxySocket;
} }
else else
...@@ -744,7 +744,7 @@ retry: ...@@ -744,7 +744,7 @@ retry:
{ {
((Socket)asyncResult.AsyncState).EndConnect(asyncResult); ((Socket)asyncResult.AsyncState).EndConnect(asyncResult);
} }
public static Task CreateTask(Socket socket, IPAddress ipAddress, int port) public static Task CreateTask(Socket socket, IPAddress ipAddress, int port)
{ {
return Task.Factory.FromAsync(beginConnect, endConnect, ipAddress, port, state: socket); return Task.Factory.FromAsync(beginConnect, endConnect, ipAddress, port, state: socket);
......
...@@ -97,7 +97,7 @@ namespace Titanium.Web.Proxy.Network.Tcp ...@@ -97,7 +97,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
await Task.Delay(1000); await Task.Delay(1000);
proxyServer.UpdateServerConnectionCount(false); proxyServer.UpdateServerConnectionCount(false);
Stream.Dispose(); Stream.Dispose();
try try
{ {
TcpSocket.Close(); TcpSocket.Close();
......
...@@ -61,7 +61,7 @@ namespace Titanium.Web.Proxy.Network.WinAuth.Security ...@@ -61,7 +61,7 @@ namespace Titanium.Web.Proxy.Network.WinAuth.Security
out clientToken, out clientToken,
out NewContextAttributes, out NewContextAttributes,
out NewLifeTime); out NewLifeTime);
if (result != IntermediateResult) if (result != IntermediateResult)
{ {
return null; return null;
......
...@@ -156,7 +156,7 @@ namespace Titanium.Web.Proxy ...@@ -156,7 +156,7 @@ namespace Titanium.Web.Proxy
response.Headers.AddHeader(KnownHeaders.ProxyAuthenticate, continuation); response.Headers.AddHeader(KnownHeaders.ProxyAuthenticate, continuation);
response.Headers.AddHeader(KnownHeaders.ProxyConnection, KnownHeaders.ConnectionKeepAlive); response.Headers.AddHeader(KnownHeaders.ProxyConnection, KnownHeaders.ConnectionKeepAlive);
response.Headers.FixProxyHeaders(); response.Headers.FixProxyHeaders();
return response; return response;
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
OF THE POSSIBILITY OF SUCH DAMAGE. OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
using System;
using System.Net.Sockets; using System.Net.Sockets;
namespace Titanium.Web.Proxy.ProxySocket.Authentication namespace Titanium.Web.Proxy.ProxySocket.Authentication
......
...@@ -152,7 +152,7 @@ namespace Titanium.Web.Proxy.ProxySocket.Authentication ...@@ -152,7 +152,7 @@ namespace Titanium.Web.Proxy.ProxySocket.Authentication
int recv = Server.EndReceive(ar); int recv = Server.EndReceive(ar);
if (recv <= 0) if (recv <= 0)
throw new SocketException(10054); throw new SocketException(10054);
Received += recv; Received += recv;
if (Received == 2) if (Received == 2)
if (Buffer[1] == 0) if (Buffer[1] == 0)
......
...@@ -136,10 +136,10 @@ namespace Titanium.Web.Proxy.ProxySocket ...@@ -136,10 +136,10 @@ namespace Titanium.Web.Proxy.ProxySocket
{ {
if (host == null) if (host == null)
throw new ArgumentNullException(); throw new ArgumentNullException();
if (port <= 0 || port > 65535 || host.Length > 255) if (port <= 0 || port > 65535 || host.Length > 255)
throw new ArgumentException(); throw new ArgumentException();
byte[] buffer = GetConnectBytes(host, port); byte[] buffer = GetConnectBytes(host, port);
if (Server.Send(buffer, 0, buffer.Length, SocketFlags.None) < buffer.Length) if (Server.Send(buffer, 0, buffer.Length, SocketFlags.None) < buffer.Length)
{ {
......
...@@ -90,7 +90,7 @@ namespace Titanium.Web.Proxy.ProxySocket ...@@ -90,7 +90,7 @@ namespace Titanium.Web.Proxy.ProxySocket
ReadBytes(buffer, 2); ReadBytes(buffer, 2);
if (buffer[1] == 255) if (buffer[1] == 255)
throw new ProxyException("No authentication method accepted."); throw new ProxyException("No authentication method accepted.");
AuthMethod authenticate; AuthMethod authenticate;
switch (buffer[1]) switch (buffer[1])
{ {
...@@ -120,7 +120,7 @@ namespace Titanium.Web.Proxy.ProxySocket ...@@ -120,7 +120,7 @@ namespace Titanium.Web.Proxy.ProxySocket
{ {
if (host == null) if (host == null)
throw new ArgumentNullException(); throw new ArgumentNullException();
if (port <= 0 || port > 65535 || host.Length > 255) if (port <= 0 || port > 65535 || host.Length > 255)
throw new ArgumentException(); throw new ArgumentException();
...@@ -206,7 +206,7 @@ namespace Titanium.Web.Proxy.ProxySocket ...@@ -206,7 +206,7 @@ namespace Titanium.Web.Proxy.ProxySocket
try try
{ {
Authenticate(buffer); Authenticate(buffer);
int length = GetEndPointBytes(remoteEP, buffer); int length = GetEndPointBytes(remoteEP, buffer);
Negotiate(buffer, length); Negotiate(buffer, length);
} }
......
...@@ -121,7 +121,7 @@ namespace Titanium.Web.Proxy.ProxySocket ...@@ -121,7 +121,7 @@ namespace Titanium.Web.Proxy.ProxySocket
int recv = Server.EndReceive(ar); int recv = Server.EndReceive(ar);
if (recv <= 0) if (recv <= 0)
throw new SocketException(10054); throw new SocketException(10054);
Received += recv; Received += recv;
} }
......
...@@ -33,7 +33,7 @@ namespace Titanium.Web.Proxy ...@@ -33,7 +33,7 @@ namespace Titanium.Web.Proxy
/// <param name="connectArgs">The Connect request if this is a HTTPS request from explicit endpoint.</param> /// <param name="connectArgs">The Connect request if this is a HTTPS request from explicit endpoint.</param>
/// <param name="prefetchConnectionTask">Prefetched server connection for current client using Connect/SNI headers.</param> /// <param name="prefetchConnectionTask">Prefetched server connection for current client using Connect/SNI headers.</param>
/// <param name="isHttps">Is HTTPS</param> /// <param name="isHttps">Is HTTPS</param>
private async Task handleHttpSessionRequest(ProxyEndPoint endPoint, HttpClientStream clientStream, private async Task handleHttpSessionRequest(ProxyEndPoint endPoint, HttpClientStream clientStream,
CancellationTokenSource cancellationTokenSource, TunnelConnectSessionEventArgs? connectArgs = null, CancellationTokenSource cancellationTokenSource, TunnelConnectSessionEventArgs? connectArgs = null,
Task<TcpServerConnection>? prefetchConnectionTask = null, bool isHttps = false) Task<TcpServerConnection>? prefetchConnectionTask = null, bool isHttps = false)
{ {
...@@ -50,7 +50,7 @@ namespace Titanium.Web.Proxy ...@@ -50,7 +50,7 @@ namespace Titanium.Web.Proxy
// Loop through each subsequent request on this particular client connection // Loop through each subsequent request on this particular client connection
// (assuming HTTP connection is kept alive by client) // (assuming HTTP connection is kept alive by client)
while (true) while (true)
{ {
if (clientStream.IsClosed) if (clientStream.IsClosed)
{ {
return; return;
...@@ -152,7 +152,7 @@ namespace Titanium.Web.Proxy ...@@ -152,7 +152,7 @@ namespace Titanium.Web.Proxy
} }
catch (SocketException e) catch (SocketException e)
{ {
if(e.SocketErrorCode != SocketError.HostNotFound) if (e.SocketErrorCode != SocketError.HostNotFound)
{ {
throw; throw;
} }
...@@ -336,7 +336,7 @@ namespace Titanium.Web.Proxy ...@@ -336,7 +336,7 @@ namespace Titanium.Web.Proxy
headerBuilder.WriteResponseLine(response.HttpVersion, response.StatusCode, response.StatusDescription); headerBuilder.WriteResponseLine(response.HttpVersion, response.StatusCode, response.StatusDescription);
headerBuilder.WriteHeaders(response.Headers); headerBuilder.WriteHeaders(response.Headers);
await writer.WriteHeadersAsync(headerBuilder, cancellationToken); await writer.WriteHeadersAsync(headerBuilder, cancellationToken);
await args.ClearResponse(cancellationToken); await args.ClearResponse(cancellationToken);
} }
......
...@@ -135,8 +135,8 @@ namespace Titanium.Web.Proxy.StreamExtended ...@@ -135,8 +135,8 @@ namespace Titanium.Web.Proxy.StreamExtended
if (CompressionData != null && CompressionData.Length > 0) if (CompressionData != null && CompressionData.Length > 0)
{ {
int compressionMethod = CompressionData[0]; int compressionMethod = CompressionData[0];
string compression = compressions.Length > compressionMethod string compression = compressions.Length > compressionMethod
? compressions[compressionMethod] ? compressions[compressionMethod]
: $"unknown [0x{compressionMethod:X2}]"; : $"unknown [0x{compressionMethod:X2}]";
sb.AppendLine($"Compression: {compression}"); sb.AppendLine($"Compression: {compression}");
} }
......
using System; using System.Threading;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Titanium.Web.Proxy.StreamExtended.Network namespace Titanium.Web.Proxy.StreamExtended.Network
......
using System; using System.Threading;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Titanium.Web.Proxy.StreamExtended.Network namespace Titanium.Web.Proxy.StreamExtended.Network
...@@ -52,5 +51,5 @@ namespace Titanium.Web.Proxy.StreamExtended.Network ...@@ -52,5 +51,5 @@ namespace Titanium.Web.Proxy.StreamExtended.Network
return buffer; return buffer;
} }
} }
} }
...@@ -105,8 +105,8 @@ namespace Titanium.Web.Proxy.StreamExtended ...@@ -105,8 +105,8 @@ namespace Titanium.Web.Proxy.StreamExtended
} }
} }
string compression = compressions.Length > CompressionMethod string compression = compressions.Length > CompressionMethod
? compressions[CompressionMethod] ? compressions[CompressionMethod]
: $"unknown [0x{CompressionMethod:X2}]"; : $"unknown [0x{CompressionMethod:X2}]";
sb.AppendLine($"Compression: {compression}"); sb.AppendLine($"Compression: {compression}");
......
...@@ -151,7 +151,7 @@ namespace Titanium.Web.Proxy.StreamExtended ...@@ -151,7 +151,7 @@ namespace Titanium.Web.Proxy.StreamExtended
Dictionary<string, SslExtension>? extensions = null; Dictionary<string, SslExtension>? extensions = null;
if(extensionsStartPosition < recordLength + 5) if (extensionsStartPosition < recordLength + 5)
{ {
extensions = await ReadExtensions(majorVersion, minorVersion, peekStream, cancellationToken); extensions = await ReadExtensions(majorVersion, minorVersion, peekStream, cancellationToken);
} }
...@@ -291,7 +291,7 @@ namespace Titanium.Web.Proxy.StreamExtended ...@@ -291,7 +291,7 @@ namespace Titanium.Web.Proxy.StreamExtended
if (extensionsStartPosition < recordLength + 5) if (extensionsStartPosition < recordLength + 5)
{ {
extensions = await ReadExtensions(majorVersion, minorVersion, peekStream, cancellationToken); extensions = await ReadExtensions(majorVersion, minorVersion, peekStream, cancellationToken);
} }
var serverHelloInfo = new ServerHelloInfo(3, majorVersion, minorVersion, random, sessionId, cipherSuite, peekStream.Position) var serverHelloInfo = new ServerHelloInfo(3, majorVersion, minorVersion, random, sessionId, cipherSuite, peekStream.Position)
......
...@@ -90,7 +90,7 @@ namespace Titanium.Web.Proxy ...@@ -90,7 +90,7 @@ namespace Titanium.Web.Proxy
} }
else else
{ {
var sessionArgs = new SessionEventArgs(this, endPoint, clientStream, null, cancellationTokenSource); var sessionArgs = new SessionEventArgs(this, endPoint, clientStream, null, cancellationTokenSource);
var connection = await tcpConnectionFactory.GetServerConnection(this, httpsHostName, port, var connection = await tcpConnectionFactory.GetServerConnection(this, httpsHostName, port,
HttpHeader.VersionUnknown, false, null, HttpHeader.VersionUnknown, false, null,
true, sessionArgs, UpStreamEndPoint, true, sessionArgs, UpStreamEndPoint,
......
...@@ -42,7 +42,7 @@ namespace Titanium.Web.Proxy ...@@ -42,7 +42,7 @@ namespace Titanium.Web.Proxy
long size = b & 0x7f; long size = b & 0x7f;
// todo: size > int.Max?? // todo: size > int.Max??
bool masked = (b & 0x80) != 0; bool masked = (b & 0x80) != 0;
int idx = 2; int idx = 2;
...@@ -100,7 +100,8 @@ namespace Titanium.Web.Proxy ...@@ -100,7 +100,8 @@ namespace Titanium.Web.Proxy
{ {
data1[pos + 2] ^= (byte)(mask >> 16); data1[pos + 2] ^= (byte)(mask >> 16);
} }
; } ;
}
} }
var frameData = buffer.Slice(idx, (int)size); var frameData = buffer.Slice(idx, (int)size);
......
...@@ -6,7 +6,7 @@ namespace Titanium.Web.Proxy ...@@ -6,7 +6,7 @@ namespace Titanium.Web.Proxy
public class WebSocketFrame public class WebSocketFrame
{ {
public bool IsFinal { get; internal set; } public bool IsFinal { get; internal set; }
public WebsocketOpCode OpCode { get; internal set; } public WebsocketOpCode OpCode { get; internal set; }
public ReadOnlyMemory<byte> Data { get; internal set; } public ReadOnlyMemory<byte> Data { get; internal set; }
......
using System; using System.Threading;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Titanium.Web.Proxy.EventArguments; using Titanium.Web.Proxy.EventArguments;
using Titanium.Web.Proxy.Helpers; using Titanium.Web.Proxy.Helpers;
...@@ -21,7 +20,7 @@ namespace Titanium.Web.Proxy ...@@ -21,7 +20,7 @@ namespace Titanium.Web.Proxy
await serverConnection.Stream.WriteRequestAsync(args.HttpClient.Request, cancellationToken); await serverConnection.Stream.WriteRequestAsync(args.HttpClient.Request, cancellationToken);
var httpStatus = await serverConnection.Stream.ReadResponseStatus(cancellationToken); var httpStatus = await serverConnection.Stream.ReadResponseStatus(cancellationToken);
var response = args.HttpClient.Response; var response = args.HttpClient.Response;
response.HttpVersion = httpStatus.Version; response.HttpVersion = httpStatus.Version;
response.StatusCode = httpStatus.StatusCode; response.StatusCode = httpStatus.StatusCode;
......
...@@ -27,7 +27,9 @@ namespace Titanium.Web.Proxy.IntegrationTests.Helpers ...@@ -27,7 +27,9 @@ namespace Titanium.Web.Proxy.IntegrationTests.Helpers
Request.ParseRequestLine(line, out var method, out var url, out var version); Request.ParseRequestLine(line, out var method, out var url, out var version);
var request = new Request var request = new Request
{ {
Method = method, RequestUriString8 = url, HttpVersion = version Method = method,
RequestUriString8 = url,
HttpVersion = version
}; };
while (!string.IsNullOrEmpty(line = reader.ReadLine())) while (!string.IsNullOrEmpty(line = reader.ReadLine()))
{ {
...@@ -72,7 +74,9 @@ namespace Titanium.Web.Proxy.IntegrationTests.Helpers ...@@ -72,7 +74,9 @@ namespace Titanium.Web.Proxy.IntegrationTests.Helpers
Response.ParseResponseLine(line, out var version, out var status, out var desc); Response.ParseResponseLine(line, out var version, out var status, out var desc);
var response = new Response var response = new Response
{ {
HttpVersion = version, StatusCode = status, StatusDescription = desc HttpVersion = version,
StatusCode = status,
StatusDescription = desc
}; };
while (!string.IsNullOrEmpty(line = reader.ReadLine())) while (!string.IsNullOrEmpty(line = reader.ReadLine()))
...@@ -107,7 +111,7 @@ namespace Titanium.Web.Proxy.IntegrationTests.Helpers ...@@ -107,7 +111,7 @@ namespace Titanium.Web.Proxy.IntegrationTests.Helpers
} }
obj.Body = Encoding.ASCII.GetBytes(reader.ReadToEnd()); obj.Body = Encoding.ASCII.GetBytes(reader.ReadToEnd());
// done reading body // done reading body
return obj.ContentLength == obj.OriginalContentLength; return obj.ContentLength == obj.OriginalContentLength;
} }
......
...@@ -14,7 +14,7 @@ namespace Titanium.Web.Proxy.IntegrationTests.Helpers ...@@ -14,7 +14,7 @@ namespace Titanium.Web.Proxy.IntegrationTests.Helpers
var handler = new HttpClientHandler var handler = new HttpClientHandler
{ {
Proxy = proxy, Proxy = proxy,
UseProxy = true UseProxy = true
}; };
return new HttpClient(handler); return new HttpClient(handler);
......
...@@ -72,7 +72,7 @@ namespace Titanium.Web.Proxy.IntegrationTests ...@@ -72,7 +72,7 @@ namespace Titanium.Web.Proxy.IntegrationTests
var client = testSuite.GetClient(proxy); var client = testSuite.GetClient(proxy);
var response = await client.PostAsync(new Uri(server.ListeningHttpUrl), var response = await client.PostAsync(new Uri(server.ListeningHttpUrl),
new StringContent("hello server. I am a client.")); new StringContent("hello server. I am a client."));
Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
......
using Microsoft.AspNetCore; using System;
using System.Linq;
using System.Net;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Connections; using Microsoft.AspNetCore.Connections;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Hosting.Server.Features; using Microsoft.AspNetCore.Hosting.Server.Features;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using System;
using System.Linq;
using System.Net;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
namespace Titanium.Web.Proxy.IntegrationTests.Setup namespace Titanium.Web.Proxy.IntegrationTests.Setup
{ {
......
using System; using System.Net.Http;
using System.Net.Http;
using Titanium.Web.Proxy.IntegrationTests.Helpers; using Titanium.Web.Proxy.IntegrationTests.Helpers;
using Titanium.Web.Proxy.IntegrationTests.Setup; using Titanium.Web.Proxy.IntegrationTests.Setup;
......
using System; using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Titanium.Web.Proxy.Network; using Titanium.Web.Proxy.Network;
namespace Titanium.Web.Proxy.UnitTests namespace Titanium.Web.Proxy.UnitTests
......
using System; using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Net; using System.Net;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Titanium.Web.Proxy.Models; using Titanium.Web.Proxy.Models;
namespace Titanium.Web.Proxy.UnitTests namespace Titanium.Web.Proxy.UnitTests
......
using System; using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Net; using System.Net;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Titanium.Web.Proxy.Helpers; using Titanium.Web.Proxy.Helpers;
using Titanium.Web.Proxy.Helpers.WinHttp; using Titanium.Web.Proxy.Helpers.WinHttp;
using Titanium.Web.Proxy.Models; using Titanium.Web.Proxy.Models;
......
using System; using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Titanium.Web.Proxy.Http; using Titanium.Web.Proxy.Http;
using Titanium.Web.Proxy.Network.WinAuth; using Titanium.Web.Proxy.Network.WinAuth;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment