diff --git a/docs/api/Titanium.Web.Proxy.EventArguments.BeforeSslAuthenticateEventArgs.html b/docs/api/Titanium.Web.Proxy.EventArguments.BeforeSslAuthenticateEventArgs.html index bb7aeecbc..4d94b6257 100644 --- a/docs/api/Titanium.Web.Proxy.EventArguments.BeforeSslAuthenticateEventArgs.html +++ b/docs/api/Titanium.Web.Proxy.EventArguments.BeforeSslAuthenticateEventArgs.html @@ -104,7 +104,7 @@

Properties Improve this Doc - View Source + View Source

DecryptSsl

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

SniHostName

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

Methods Improve this Doc - View Source + View Source

TerminateSession()

@@ -193,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 b05b43464..fe2eb72d6 100644 --- a/docs/api/Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.html +++ b/docs/api/Titanium.Web.Proxy.EventArguments.CertificateSelectionEventArgs.html @@ -104,7 +104,7 @@

    Constructors Improve this Doc - View Source + View Source

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

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

    Properties Improve this Doc - View Source + View Source

    AcceptableIssuers

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

    ClientCertificate

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

    LocalCertificates

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

    RemoteCertificate

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

    Session

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

    TargetHost

    @@ -350,7 +350,7 @@
    Property Value
    Improve this Doc
  • - View Source + View Source
  • diff --git a/docs/api/Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.html b/docs/api/Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.html index cf1d4016b..97ef6bf4a 100644 --- a/docs/api/Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.html +++ b/docs/api/Titanium.Web.Proxy.EventArguments.CertificateValidationEventArgs.html @@ -105,7 +105,7 @@

    Constructors Improve this Doc - View Source + View Source

    CertificateValidationEventArgs(SessionEventArgsBase, X509Certificate, X509Chain, SslPolicyErrors)

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

    Properties Improve this Doc - View Source + View Source

    Certificate

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

    Chain

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

    IsValid

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

    Session

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

    SslPolicyErrors

    @@ -315,7 +315,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 c40bbbd7e..200103068 100644 --- a/docs/api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html +++ b/docs/api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html @@ -184,7 +184,7 @@

    Properties Improve this Doc - View Source + View Source

    IsPromise

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

    ReRequest

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

    WebSocketDecoder

    @@ -254,7 +254,68 @@

    Declaration
    -
    public WebSocketDecoder WebSocketDecoder { get; }
    +
    [Obsolete("Use [WebSocketDecoderReceive] instead")]
    +public WebSocketDecoder WebSocketDecoder { get; }
    +
    +
    Property Value
    + + + + + + + + + + + + + +
    TypeDescription
    WebSocketDecoder
    + + | + Improve this Doc + + + View Source + + +

    WebSocketDecoderReceive

    +
    +
    +
    Declaration
    +
    +
    public WebSocketDecoder WebSocketDecoderReceive { get; }
    +
    +
    Property Value
    + + + + + + + + + + + + + +
    TypeDescription
    WebSocketDecoder
    + + | + Improve this Doc + + + View Source + + +

    WebSocketDecoderSend

    +
    +
    +
    Declaration
    +
    +
    public WebSocketDecoder WebSocketDecoderSend { get; }
    Property Value
    @@ -278,7 +339,7 @@

    Methods Improve this Doc - View Source + View Source

    Dispose()

    @@ -296,7 +357,7 @@
    Overrides
    Improve this Doc - View Source + View Source

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

    @@ -349,7 +410,7 @@
    Parameters
    Improve this Doc - View Source + View Source

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

    @@ -403,7 +464,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    GetRequestBody(CancellationToken)

    @@ -453,7 +514,7 @@
    Returns
    Improve this Doc - View Source + View Source

    GetRequestBodyAsString(CancellationToken)

    @@ -503,7 +564,7 @@
    Returns
    Improve this Doc - View Source + View Source

    GetResponseBody(CancellationToken)

    @@ -553,7 +614,7 @@
    Returns
    Improve this Doc - View Source + View Source

    GetResponseBodyAsString(CancellationToken)

    @@ -603,7 +664,7 @@
    Returns
    Improve this Doc - View Source + View Source

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

    @@ -650,7 +711,7 @@
    Parameters
    Improve this Doc - View Source + View Source

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

    @@ -697,7 +758,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    Redirect(String, Boolean)

    @@ -737,7 +798,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    Respond(Response, Boolean)

    @@ -777,7 +838,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    SetRequestBody(Byte[])

    @@ -811,7 +872,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    SetRequestBodyString(String)

    @@ -845,7 +906,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    SetResponseBody(Byte[])

    @@ -879,7 +940,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    SetResponseBodyString(String)

    @@ -913,7 +974,7 @@
    Parameters
    Improve this Doc - View Source + View Source

    TerminateServerConnection()

    @@ -931,7 +992,7 @@

    Events Improve this Doc - View Source + View Source

    MultipartRequestPartSent

    Occurs when multipart request part sent.

    diff --git a/docs/api/Titanium.Web.Proxy.Http.ConnectRequest.html b/docs/api/Titanium.Web.Proxy.Http.ConnectRequest.html index e3c7a2e0e..cbe258d10 100644 --- a/docs/api/Titanium.Web.Proxy.Http.ConnectRequest.html +++ b/docs/api/Titanium.Web.Proxy.Http.ConnectRequest.html @@ -205,7 +205,7 @@

    Properties Improve this Doc - View Source + View Source

    ClientHelloInfo

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

    TunnelType

    @@ -271,7 +271,7 @@
    Property Value
    Improve this Doc
  • - View Source + View Source
  • 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 116ea1f49..8db631eed 100644 --- a/docs/api/Titanium.Web.Proxy.Http2.Hpack.HpackUtil.IndexType.html +++ b/docs/api/Titanium.Web.Proxy.Http2.Hpack.HpackUtil.IndexType.html @@ -126,7 +126,7 @@

    Fields Improve this Doc
  • - View Source + View Source
  • diff --git a/docs/api/Titanium.Web.Proxy.Http2.Hpack.HpackUtil.html b/docs/api/Titanium.Web.Proxy.Http2.Hpack.HpackUtil.html index 5d90c9c2f..c3a443245 100644 --- a/docs/api/Titanium.Web.Proxy.Http2.Hpack.HpackUtil.html +++ b/docs/api/Titanium.Web.Proxy.Http2.Hpack.HpackUtil.html @@ -127,7 +127,7 @@

    Fields Improve this Doc - View Source + View Source

    HuffmanCodeLengths

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

    HuffmanCodes

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

    HuffmanEos

    @@ -220,7 +220,7 @@
    Field Value
    Improve this Doc
  • - View Source + View Source
  • diff --git a/docs/api/Titanium.Web.Proxy.ProxyServer.html b/docs/api/Titanium.Web.Proxy.ProxyServer.html index e83d17f78..50c2d2157 100644 --- a/docs/api/Titanium.Web.Proxy.ProxyServer.html +++ b/docs/api/Titanium.Web.Proxy.ProxyServer.html @@ -298,7 +298,7 @@
    Property Value
    - + diff --git a/docs/api/toc.html b/docs/api/toc.html index 705a256d5..628ad92e4 100644 --- a/docs/api/toc.html +++ b/docs/api/toc.html @@ -191,19 +191,6 @@ -
  • - - Titanium.Web.Proxy.Network - - -
  • diff --git a/docs/index.json b/docs/index.json index d2ac68d68..d38e9c7c6 100644 --- a/docs/index.json +++ b/docs/index.json @@ -32,7 +32,7 @@ "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 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.IsSocks 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" + "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.IsSocks 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 [Obsolete(\"Use [WebSocketDecoderReceive] instead\")] public WebSocketDecoder WebSocketDecoder { get; } Property Value Type Description WebSocketDecoder | Improve this Doc View Source WebSocketDecoderReceive Declaration public WebSocketDecoder WebSocketDecoderReceive { get; } Property Value Type Description WebSocketDecoder | Improve this Doc View Source WebSocketDecoderSend Declaration public WebSocketDecoder WebSocketDecoderSend { 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", @@ -239,21 +239,6 @@ "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 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", - "title": "Enum CertificateEngine | Titanium Web Proxy", - "keywords": "Enum CertificateEngine Certificate Engine option. Namespace : Titanium.Web.Proxy.Network Assembly : Titanium.Web.Proxy.dll Syntax public enum CertificateEngine Fields Name Description BouncyCastle Uses BouncyCastle 3rd party library. Default. BouncyCastleFast DefaultWindows Uses Windows Certification Generation API and only valid in Windows OS. Observed to be faster than BouncyCastle. Bug #468 Reported." - }, - "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.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", - "title": "Namespace Titanium.Web.Proxy.Network | Titanium Web Proxy", - "keywords": "Namespace Titanium.Web.Proxy.Network Classes CertificateManager A class to manage SSL certificates used by this proxy server. Enums CertificateEngine Certificate Engine option." - }, "api/Titanium.Web.Proxy.ProxyServer.html": { "href": "api/Titanium.Web.Proxy.ProxyServer.html", "title": "Class ProxyServer | Titanium Web Proxy", diff --git a/docs/xrefmap.yml b/docs/xrefmap.yml index 25ca044f3..fe53085ef 100644 --- a/docs/xrefmap.yml +++ b/docs/xrefmap.yml @@ -559,6 +559,32 @@ references: isSpec: "True" fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.WebSocketDecoder nameWithType: SessionEventArgs.WebSocketDecoder +- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.WebSocketDecoderReceive + name: WebSocketDecoderReceive + href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs_WebSocketDecoderReceive + commentId: P:Titanium.Web.Proxy.EventArguments.SessionEventArgs.WebSocketDecoderReceive + fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.WebSocketDecoderReceive + nameWithType: SessionEventArgs.WebSocketDecoderReceive +- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.WebSocketDecoderReceive* + name: WebSocketDecoderReceive + href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs_WebSocketDecoderReceive_ + commentId: Overload:Titanium.Web.Proxy.EventArguments.SessionEventArgs.WebSocketDecoderReceive + isSpec: "True" + fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.WebSocketDecoderReceive + nameWithType: SessionEventArgs.WebSocketDecoderReceive +- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.WebSocketDecoderSend + name: WebSocketDecoderSend + href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs_WebSocketDecoderSend + commentId: P:Titanium.Web.Proxy.EventArguments.SessionEventArgs.WebSocketDecoderSend + fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.WebSocketDecoderSend + nameWithType: SessionEventArgs.WebSocketDecoderSend +- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.WebSocketDecoderSend* + name: WebSocketDecoderSend + href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs_WebSocketDecoderSend_ + commentId: Overload:Titanium.Web.Proxy.EventArguments.SessionEventArgs.WebSocketDecoderSend + isSpec: "True" + fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.WebSocketDecoderSend + nameWithType: SessionEventArgs.WebSocketDecoderSend - uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase name: SessionEventArgsBase href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html @@ -2895,353 +2921,6 @@ references: isSpec: "True" fullName: Titanium.Web.Proxy.Models.TransparentProxyEndPoint.GenericCertificateName nameWithType: TransparentProxyEndPoint.GenericCertificateName -- uid: Titanium.Web.Proxy.Network - name: Titanium.Web.Proxy.Network - href: api/Titanium.Web.Proxy.Network.html - commentId: N:Titanium.Web.Proxy.Network - fullName: Titanium.Web.Proxy.Network - nameWithType: Titanium.Web.Proxy.Network -- uid: Titanium.Web.Proxy.Network.CertificateEngine - name: CertificateEngine - href: api/Titanium.Web.Proxy.Network.CertificateEngine.html - commentId: T:Titanium.Web.Proxy.Network.CertificateEngine - fullName: Titanium.Web.Proxy.Network.CertificateEngine - nameWithType: CertificateEngine -- uid: Titanium.Web.Proxy.Network.CertificateEngine.BouncyCastle - name: BouncyCastle - href: api/Titanium.Web.Proxy.Network.CertificateEngine.html#Titanium_Web_Proxy_Network_CertificateEngine_BouncyCastle - commentId: F:Titanium.Web.Proxy.Network.CertificateEngine.BouncyCastle - fullName: Titanium.Web.Proxy.Network.CertificateEngine.BouncyCastle - nameWithType: CertificateEngine.BouncyCastle -- uid: Titanium.Web.Proxy.Network.CertificateEngine.BouncyCastleFast - name: BouncyCastleFast - href: api/Titanium.Web.Proxy.Network.CertificateEngine.html#Titanium_Web_Proxy_Network_CertificateEngine_BouncyCastleFast - commentId: F:Titanium.Web.Proxy.Network.CertificateEngine.BouncyCastleFast - fullName: Titanium.Web.Proxy.Network.CertificateEngine.BouncyCastleFast - nameWithType: CertificateEngine.BouncyCastleFast -- uid: Titanium.Web.Proxy.Network.CertificateEngine.DefaultWindows - name: DefaultWindows - href: api/Titanium.Web.Proxy.Network.CertificateEngine.html#Titanium_Web_Proxy_Network_CertificateEngine_DefaultWindows - commentId: F:Titanium.Web.Proxy.Network.CertificateEngine.DefaultWindows - fullName: Titanium.Web.Proxy.Network.CertificateEngine.DefaultWindows - nameWithType: CertificateEngine.DefaultWindows -- uid: Titanium.Web.Proxy.Network.CertificateManager - name: CertificateManager - href: api/Titanium.Web.Proxy.Network.CertificateManager.html - commentId: T:Titanium.Web.Proxy.Network.CertificateManager - fullName: Titanium.Web.Proxy.Network.CertificateManager - nameWithType: CertificateManager -- uid: Titanium.Web.Proxy.Network.CertificateManager.CertificateCacheTimeOutMinutes - name: CertificateCacheTimeOutMinutes - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_CertificateCacheTimeOutMinutes - commentId: P:Titanium.Web.Proxy.Network.CertificateManager.CertificateCacheTimeOutMinutes - fullName: Titanium.Web.Proxy.Network.CertificateManager.CertificateCacheTimeOutMinutes - nameWithType: CertificateManager.CertificateCacheTimeOutMinutes -- uid: Titanium.Web.Proxy.Network.CertificateManager.CertificateCacheTimeOutMinutes* - name: CertificateCacheTimeOutMinutes - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_CertificateCacheTimeOutMinutes_ - commentId: Overload:Titanium.Web.Proxy.Network.CertificateManager.CertificateCacheTimeOutMinutes - isSpec: "True" - fullName: Titanium.Web.Proxy.Network.CertificateManager.CertificateCacheTimeOutMinutes - nameWithType: CertificateManager.CertificateCacheTimeOutMinutes -- uid: Titanium.Web.Proxy.Network.CertificateManager.CertificateEngine - name: CertificateEngine - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_CertificateEngine - commentId: P:Titanium.Web.Proxy.Network.CertificateManager.CertificateEngine - fullName: Titanium.Web.Proxy.Network.CertificateManager.CertificateEngine - nameWithType: CertificateManager.CertificateEngine -- uid: Titanium.Web.Proxy.Network.CertificateManager.CertificateEngine* - name: CertificateEngine - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_CertificateEngine_ - commentId: Overload:Titanium.Web.Proxy.Network.CertificateManager.CertificateEngine - isSpec: "True" - fullName: Titanium.Web.Proxy.Network.CertificateManager.CertificateEngine - nameWithType: CertificateManager.CertificateEngine -- uid: Titanium.Web.Proxy.Network.CertificateManager.CertificateStorage - name: CertificateStorage - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_CertificateStorage - commentId: P:Titanium.Web.Proxy.Network.CertificateManager.CertificateStorage - fullName: Titanium.Web.Proxy.Network.CertificateManager.CertificateStorage - nameWithType: CertificateManager.CertificateStorage -- uid: Titanium.Web.Proxy.Network.CertificateManager.CertificateStorage* - name: CertificateStorage - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_CertificateStorage_ - commentId: Overload:Titanium.Web.Proxy.Network.CertificateManager.CertificateStorage - isSpec: "True" - fullName: Titanium.Web.Proxy.Network.CertificateManager.CertificateStorage - nameWithType: CertificateManager.CertificateStorage -- uid: Titanium.Web.Proxy.Network.CertificateManager.ClearRootCertificate - name: ClearRootCertificate() - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_ClearRootCertificate - commentId: M:Titanium.Web.Proxy.Network.CertificateManager.ClearRootCertificate - fullName: Titanium.Web.Proxy.Network.CertificateManager.ClearRootCertificate() - nameWithType: CertificateManager.ClearRootCertificate() -- uid: Titanium.Web.Proxy.Network.CertificateManager.ClearRootCertificate* - name: ClearRootCertificate - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_ClearRootCertificate_ - commentId: Overload:Titanium.Web.Proxy.Network.CertificateManager.ClearRootCertificate - isSpec: "True" - fullName: Titanium.Web.Proxy.Network.CertificateManager.ClearRootCertificate - nameWithType: CertificateManager.ClearRootCertificate -- uid: Titanium.Web.Proxy.Network.CertificateManager.CreateRootCertificate(System.Boolean) - name: CreateRootCertificate(Boolean) - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_CreateRootCertificate_System_Boolean_ - commentId: M:Titanium.Web.Proxy.Network.CertificateManager.CreateRootCertificate(System.Boolean) - fullName: Titanium.Web.Proxy.Network.CertificateManager.CreateRootCertificate(System.Boolean) - nameWithType: CertificateManager.CreateRootCertificate(Boolean) -- uid: Titanium.Web.Proxy.Network.CertificateManager.CreateRootCertificate* - name: CreateRootCertificate - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_CreateRootCertificate_ - commentId: Overload:Titanium.Web.Proxy.Network.CertificateManager.CreateRootCertificate - isSpec: "True" - fullName: Titanium.Web.Proxy.Network.CertificateManager.CreateRootCertificate - nameWithType: CertificateManager.CreateRootCertificate -- uid: Titanium.Web.Proxy.Network.CertificateManager.CreateServerCertificate(System.String) - name: CreateServerCertificate(String) - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_CreateServerCertificate_System_String_ - commentId: M:Titanium.Web.Proxy.Network.CertificateManager.CreateServerCertificate(System.String) - fullName: Titanium.Web.Proxy.Network.CertificateManager.CreateServerCertificate(System.String) - nameWithType: CertificateManager.CreateServerCertificate(String) -- uid: Titanium.Web.Proxy.Network.CertificateManager.CreateServerCertificate* - name: CreateServerCertificate - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_CreateServerCertificate_ - commentId: Overload:Titanium.Web.Proxy.Network.CertificateManager.CreateServerCertificate - isSpec: "True" - fullName: Titanium.Web.Proxy.Network.CertificateManager.CreateServerCertificate - nameWithType: CertificateManager.CreateServerCertificate -- uid: Titanium.Web.Proxy.Network.CertificateManager.Dispose - name: Dispose() - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_Dispose - commentId: M:Titanium.Web.Proxy.Network.CertificateManager.Dispose - fullName: Titanium.Web.Proxy.Network.CertificateManager.Dispose() - nameWithType: CertificateManager.Dispose() -- uid: Titanium.Web.Proxy.Network.CertificateManager.Dispose* - name: Dispose - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_Dispose_ - commentId: Overload:Titanium.Web.Proxy.Network.CertificateManager.Dispose - isSpec: "True" - fullName: Titanium.Web.Proxy.Network.CertificateManager.Dispose - nameWithType: CertificateManager.Dispose -- uid: Titanium.Web.Proxy.Network.CertificateManager.EnsureRootCertificate - name: EnsureRootCertificate() - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_EnsureRootCertificate - commentId: M:Titanium.Web.Proxy.Network.CertificateManager.EnsureRootCertificate - fullName: Titanium.Web.Proxy.Network.CertificateManager.EnsureRootCertificate() - nameWithType: CertificateManager.EnsureRootCertificate() -- uid: Titanium.Web.Proxy.Network.CertificateManager.EnsureRootCertificate(System.Boolean,System.Boolean,System.Boolean) - name: EnsureRootCertificate(Boolean, Boolean, Boolean) - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_EnsureRootCertificate_System_Boolean_System_Boolean_System_Boolean_ - commentId: M:Titanium.Web.Proxy.Network.CertificateManager.EnsureRootCertificate(System.Boolean,System.Boolean,System.Boolean) - fullName: Titanium.Web.Proxy.Network.CertificateManager.EnsureRootCertificate(System.Boolean, System.Boolean, System.Boolean) - nameWithType: CertificateManager.EnsureRootCertificate(Boolean, Boolean, Boolean) -- uid: Titanium.Web.Proxy.Network.CertificateManager.EnsureRootCertificate* - name: EnsureRootCertificate - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_EnsureRootCertificate_ - commentId: Overload:Titanium.Web.Proxy.Network.CertificateManager.EnsureRootCertificate - isSpec: "True" - fullName: Titanium.Web.Proxy.Network.CertificateManager.EnsureRootCertificate - nameWithType: CertificateManager.EnsureRootCertificate -- uid: Titanium.Web.Proxy.Network.CertificateManager.IsRootCertificateMachineTrusted - name: IsRootCertificateMachineTrusted() - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_IsRootCertificateMachineTrusted - commentId: M:Titanium.Web.Proxy.Network.CertificateManager.IsRootCertificateMachineTrusted - fullName: Titanium.Web.Proxy.Network.CertificateManager.IsRootCertificateMachineTrusted() - nameWithType: CertificateManager.IsRootCertificateMachineTrusted() -- uid: Titanium.Web.Proxy.Network.CertificateManager.IsRootCertificateMachineTrusted* - name: IsRootCertificateMachineTrusted - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_IsRootCertificateMachineTrusted_ - commentId: Overload:Titanium.Web.Proxy.Network.CertificateManager.IsRootCertificateMachineTrusted - isSpec: "True" - fullName: Titanium.Web.Proxy.Network.CertificateManager.IsRootCertificateMachineTrusted - nameWithType: CertificateManager.IsRootCertificateMachineTrusted -- uid: Titanium.Web.Proxy.Network.CertificateManager.IsRootCertificateUserTrusted - name: IsRootCertificateUserTrusted() - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_IsRootCertificateUserTrusted - commentId: M:Titanium.Web.Proxy.Network.CertificateManager.IsRootCertificateUserTrusted - fullName: Titanium.Web.Proxy.Network.CertificateManager.IsRootCertificateUserTrusted() - nameWithType: CertificateManager.IsRootCertificateUserTrusted() -- uid: Titanium.Web.Proxy.Network.CertificateManager.IsRootCertificateUserTrusted* - name: IsRootCertificateUserTrusted - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_IsRootCertificateUserTrusted_ - commentId: Overload:Titanium.Web.Proxy.Network.CertificateManager.IsRootCertificateUserTrusted - isSpec: "True" - fullName: Titanium.Web.Proxy.Network.CertificateManager.IsRootCertificateUserTrusted - nameWithType: CertificateManager.IsRootCertificateUserTrusted -- uid: Titanium.Web.Proxy.Network.CertificateManager.LoadRootCertificate - name: LoadRootCertificate() - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_LoadRootCertificate - commentId: M:Titanium.Web.Proxy.Network.CertificateManager.LoadRootCertificate - fullName: Titanium.Web.Proxy.Network.CertificateManager.LoadRootCertificate() - nameWithType: CertificateManager.LoadRootCertificate() -- uid: Titanium.Web.Proxy.Network.CertificateManager.LoadRootCertificate(System.String,System.String,System.Boolean,System.Security.Cryptography.X509Certificates.X509KeyStorageFlags) - name: LoadRootCertificate(String, String, Boolean, X509KeyStorageFlags) - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_LoadRootCertificate_System_String_System_String_System_Boolean_System_Security_Cryptography_X509Certificates_X509KeyStorageFlags_ - commentId: M:Titanium.Web.Proxy.Network.CertificateManager.LoadRootCertificate(System.String,System.String,System.Boolean,System.Security.Cryptography.X509Certificates.X509KeyStorageFlags) - fullName: Titanium.Web.Proxy.Network.CertificateManager.LoadRootCertificate(System.String, System.String, System.Boolean, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags) - nameWithType: CertificateManager.LoadRootCertificate(String, String, Boolean, X509KeyStorageFlags) -- uid: Titanium.Web.Proxy.Network.CertificateManager.LoadRootCertificate* - name: LoadRootCertificate - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_LoadRootCertificate_ - commentId: Overload:Titanium.Web.Proxy.Network.CertificateManager.LoadRootCertificate - isSpec: "True" - fullName: Titanium.Web.Proxy.Network.CertificateManager.LoadRootCertificate - nameWithType: CertificateManager.LoadRootCertificate -- uid: Titanium.Web.Proxy.Network.CertificateManager.OverwritePfxFile - name: OverwritePfxFile - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_OverwritePfxFile - commentId: P:Titanium.Web.Proxy.Network.CertificateManager.OverwritePfxFile - fullName: Titanium.Web.Proxy.Network.CertificateManager.OverwritePfxFile - nameWithType: CertificateManager.OverwritePfxFile -- uid: Titanium.Web.Proxy.Network.CertificateManager.OverwritePfxFile* - name: OverwritePfxFile - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_OverwritePfxFile_ - commentId: Overload:Titanium.Web.Proxy.Network.CertificateManager.OverwritePfxFile - isSpec: "True" - fullName: Titanium.Web.Proxy.Network.CertificateManager.OverwritePfxFile - nameWithType: CertificateManager.OverwritePfxFile -- uid: Titanium.Web.Proxy.Network.CertificateManager.PfxFilePath - name: PfxFilePath - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_PfxFilePath - commentId: P:Titanium.Web.Proxy.Network.CertificateManager.PfxFilePath - fullName: Titanium.Web.Proxy.Network.CertificateManager.PfxFilePath - nameWithType: CertificateManager.PfxFilePath -- uid: Titanium.Web.Proxy.Network.CertificateManager.PfxFilePath* - name: PfxFilePath - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_PfxFilePath_ - commentId: Overload:Titanium.Web.Proxy.Network.CertificateManager.PfxFilePath - isSpec: "True" - fullName: Titanium.Web.Proxy.Network.CertificateManager.PfxFilePath - nameWithType: CertificateManager.PfxFilePath -- uid: Titanium.Web.Proxy.Network.CertificateManager.PfxPassword - name: PfxPassword - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_PfxPassword - commentId: P:Titanium.Web.Proxy.Network.CertificateManager.PfxPassword - fullName: Titanium.Web.Proxy.Network.CertificateManager.PfxPassword - nameWithType: CertificateManager.PfxPassword -- uid: Titanium.Web.Proxy.Network.CertificateManager.PfxPassword* - name: PfxPassword - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_PfxPassword_ - commentId: Overload:Titanium.Web.Proxy.Network.CertificateManager.PfxPassword - isSpec: "True" - fullName: Titanium.Web.Proxy.Network.CertificateManager.PfxPassword - nameWithType: CertificateManager.PfxPassword -- uid: Titanium.Web.Proxy.Network.CertificateManager.RemoveTrustedRootCertificate(System.Boolean) - name: RemoveTrustedRootCertificate(Boolean) - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_RemoveTrustedRootCertificate_System_Boolean_ - commentId: M:Titanium.Web.Proxy.Network.CertificateManager.RemoveTrustedRootCertificate(System.Boolean) - fullName: Titanium.Web.Proxy.Network.CertificateManager.RemoveTrustedRootCertificate(System.Boolean) - nameWithType: CertificateManager.RemoveTrustedRootCertificate(Boolean) -- uid: Titanium.Web.Proxy.Network.CertificateManager.RemoveTrustedRootCertificate* - name: RemoveTrustedRootCertificate - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_RemoveTrustedRootCertificate_ - commentId: Overload:Titanium.Web.Proxy.Network.CertificateManager.RemoveTrustedRootCertificate - isSpec: "True" - fullName: Titanium.Web.Proxy.Network.CertificateManager.RemoveTrustedRootCertificate - nameWithType: CertificateManager.RemoveTrustedRootCertificate -- uid: Titanium.Web.Proxy.Network.CertificateManager.RemoveTrustedRootCertificateAsAdmin(System.Boolean) - name: RemoveTrustedRootCertificateAsAdmin(Boolean) - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_RemoveTrustedRootCertificateAsAdmin_System_Boolean_ - commentId: M:Titanium.Web.Proxy.Network.CertificateManager.RemoveTrustedRootCertificateAsAdmin(System.Boolean) - fullName: Titanium.Web.Proxy.Network.CertificateManager.RemoveTrustedRootCertificateAsAdmin(System.Boolean) - nameWithType: CertificateManager.RemoveTrustedRootCertificateAsAdmin(Boolean) -- uid: Titanium.Web.Proxy.Network.CertificateManager.RemoveTrustedRootCertificateAsAdmin* - name: RemoveTrustedRootCertificateAsAdmin - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_RemoveTrustedRootCertificateAsAdmin_ - commentId: Overload:Titanium.Web.Proxy.Network.CertificateManager.RemoveTrustedRootCertificateAsAdmin - isSpec: "True" - fullName: Titanium.Web.Proxy.Network.CertificateManager.RemoveTrustedRootCertificateAsAdmin - nameWithType: CertificateManager.RemoveTrustedRootCertificateAsAdmin -- uid: Titanium.Web.Proxy.Network.CertificateManager.RootCertificate - name: RootCertificate - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_RootCertificate - commentId: P:Titanium.Web.Proxy.Network.CertificateManager.RootCertificate - fullName: Titanium.Web.Proxy.Network.CertificateManager.RootCertificate - nameWithType: CertificateManager.RootCertificate -- uid: Titanium.Web.Proxy.Network.CertificateManager.RootCertificate* - name: RootCertificate - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_RootCertificate_ - commentId: Overload:Titanium.Web.Proxy.Network.CertificateManager.RootCertificate - isSpec: "True" - fullName: Titanium.Web.Proxy.Network.CertificateManager.RootCertificate - nameWithType: CertificateManager.RootCertificate -- uid: Titanium.Web.Proxy.Network.CertificateManager.RootCertificateIssuerName - name: RootCertificateIssuerName - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_RootCertificateIssuerName - commentId: P:Titanium.Web.Proxy.Network.CertificateManager.RootCertificateIssuerName - fullName: Titanium.Web.Proxy.Network.CertificateManager.RootCertificateIssuerName - nameWithType: CertificateManager.RootCertificateIssuerName -- uid: Titanium.Web.Proxy.Network.CertificateManager.RootCertificateIssuerName* - name: RootCertificateIssuerName - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_RootCertificateIssuerName_ - commentId: Overload:Titanium.Web.Proxy.Network.CertificateManager.RootCertificateIssuerName - isSpec: "True" - fullName: Titanium.Web.Proxy.Network.CertificateManager.RootCertificateIssuerName - nameWithType: CertificateManager.RootCertificateIssuerName -- uid: Titanium.Web.Proxy.Network.CertificateManager.RootCertificateName - name: RootCertificateName - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_RootCertificateName - commentId: P:Titanium.Web.Proxy.Network.CertificateManager.RootCertificateName - fullName: Titanium.Web.Proxy.Network.CertificateManager.RootCertificateName - nameWithType: CertificateManager.RootCertificateName -- uid: Titanium.Web.Proxy.Network.CertificateManager.RootCertificateName* - name: RootCertificateName - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_RootCertificateName_ - commentId: Overload:Titanium.Web.Proxy.Network.CertificateManager.RootCertificateName - isSpec: "True" - fullName: Titanium.Web.Proxy.Network.CertificateManager.RootCertificateName - nameWithType: CertificateManager.RootCertificateName -- uid: Titanium.Web.Proxy.Network.CertificateManager.SaveFakeCertificates - name: SaveFakeCertificates - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_SaveFakeCertificates - commentId: P:Titanium.Web.Proxy.Network.CertificateManager.SaveFakeCertificates - fullName: Titanium.Web.Proxy.Network.CertificateManager.SaveFakeCertificates - nameWithType: CertificateManager.SaveFakeCertificates -- uid: Titanium.Web.Proxy.Network.CertificateManager.SaveFakeCertificates* - name: SaveFakeCertificates - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_SaveFakeCertificates_ - commentId: Overload:Titanium.Web.Proxy.Network.CertificateManager.SaveFakeCertificates - isSpec: "True" - fullName: Titanium.Web.Proxy.Network.CertificateManager.SaveFakeCertificates - nameWithType: CertificateManager.SaveFakeCertificates -- uid: Titanium.Web.Proxy.Network.CertificateManager.StorageFlag - name: StorageFlag - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_StorageFlag - commentId: P:Titanium.Web.Proxy.Network.CertificateManager.StorageFlag - fullName: Titanium.Web.Proxy.Network.CertificateManager.StorageFlag - nameWithType: CertificateManager.StorageFlag -- uid: Titanium.Web.Proxy.Network.CertificateManager.StorageFlag* - name: StorageFlag - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_StorageFlag_ - commentId: Overload:Titanium.Web.Proxy.Network.CertificateManager.StorageFlag - isSpec: "True" - fullName: Titanium.Web.Proxy.Network.CertificateManager.StorageFlag - nameWithType: CertificateManager.StorageFlag -- uid: Titanium.Web.Proxy.Network.CertificateManager.TrustRootCertificate(System.Boolean) - name: TrustRootCertificate(Boolean) - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_TrustRootCertificate_System_Boolean_ - commentId: M:Titanium.Web.Proxy.Network.CertificateManager.TrustRootCertificate(System.Boolean) - fullName: Titanium.Web.Proxy.Network.CertificateManager.TrustRootCertificate(System.Boolean) - nameWithType: CertificateManager.TrustRootCertificate(Boolean) -- uid: Titanium.Web.Proxy.Network.CertificateManager.TrustRootCertificate* - name: TrustRootCertificate - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_TrustRootCertificate_ - commentId: Overload:Titanium.Web.Proxy.Network.CertificateManager.TrustRootCertificate - isSpec: "True" - fullName: Titanium.Web.Proxy.Network.CertificateManager.TrustRootCertificate - nameWithType: CertificateManager.TrustRootCertificate -- uid: Titanium.Web.Proxy.Network.CertificateManager.TrustRootCertificateAsAdmin(System.Boolean) - name: TrustRootCertificateAsAdmin(Boolean) - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_TrustRootCertificateAsAdmin_System_Boolean_ - commentId: M:Titanium.Web.Proxy.Network.CertificateManager.TrustRootCertificateAsAdmin(System.Boolean) - fullName: Titanium.Web.Proxy.Network.CertificateManager.TrustRootCertificateAsAdmin(System.Boolean) - nameWithType: CertificateManager.TrustRootCertificateAsAdmin(Boolean) -- uid: Titanium.Web.Proxy.Network.CertificateManager.TrustRootCertificateAsAdmin* - name: TrustRootCertificateAsAdmin - href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_TrustRootCertificateAsAdmin_ - commentId: Overload:Titanium.Web.Proxy.Network.CertificateManager.TrustRootCertificateAsAdmin - isSpec: "True" - fullName: Titanium.Web.Proxy.Network.CertificateManager.TrustRootCertificateAsAdmin - nameWithType: CertificateManager.TrustRootCertificateAsAdmin - uid: Titanium.Web.Proxy.ProxyServer name: ProxyServer href: api/Titanium.Web.Proxy.ProxyServer.html diff --git a/examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs b/examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs index d2f079179..ecd8bba30 100644 --- a/examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs +++ b/examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs @@ -156,7 +156,11 @@ private async Task onGetCustomUpStreamProxyFunc(SessionEventArgs // this is just to show the functionality, provided values are junk 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 }; } @@ -168,7 +172,11 @@ private async Task onCustomUpStreamProxyFailureFunc(SessionEvent // this is just to show the functionality, provided values are junk 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 }; } @@ -422,4 +430,3 @@ private async Task writeToConsole(string message, ConsoleColor? consoleColor = n //} } } - diff --git a/examples/Titanium.Web.Proxy.Examples.Basic/SampleClientState.cs b/examples/Titanium.Web.Proxy.Examples.Basic/SampleClientState.cs index 163952680..b86ea4105 100644 --- a/examples/Titanium.Web.Proxy.Examples.Basic/SampleClientState.cs +++ b/examples/Titanium.Web.Proxy.Examples.Basic/SampleClientState.cs @@ -1,5 +1,4 @@ -using System; -using System.Text; +using System.Text; namespace Titanium.Web.Proxy.Examples.Basic { diff --git a/examples/Titanium.Web.Proxy.Examples.Wpf/MainWindow.xaml.cs b/examples/Titanium.Web.Proxy.Examples.Wpf/MainWindow.xaml.cs index d3fec7226..8afbd0f02 100644 --- a/examples/Titanium.Web.Proxy.Examples.Wpf/MainWindow.xaml.cs +++ b/examples/Titanium.Web.Proxy.Examples.Wpf/MainWindow.xaml.cs @@ -104,7 +104,7 @@ public MainWindow() Dispatcher.Invoke(() => { ServerConnectionCount = proxyServer.ServerConnectionCount; }); }; proxyServer.Start(); - + proxyServer.SetAsSystemProxy(explicitEndPoint, ProxyProtocolType.AllHttp); InitializeComponent(); @@ -279,7 +279,7 @@ private SessionListItem createSessionListItem(SessionEventArgsBase e) li.SentDataCount += args.Count; //if (tunnelType == TunnelType.Http2) - AppendTransferLog( session.GetHashCode() + (isTunnelConnect ? "_tunnel" : "") + "_sent", + AppendTransferLog(session.GetHashCode() + (isTunnelConnect ? "_tunnel" : "") + "_sent", args.Buffer, args.Offset, args.Count); } }; diff --git a/src/Titanium.Web.Proxy/Network/Certificate/BCCertificateMaker.cs b/src/Titanium.Web.Proxy/Certificates/BCCertificateMaker.cs similarity index 99% rename from src/Titanium.Web.Proxy/Network/Certificate/BCCertificateMaker.cs rename to src/Titanium.Web.Proxy/Certificates/BCCertificateMaker.cs index c77131936..5d104c511 100644 --- a/src/Titanium.Web.Proxy/Network/Certificate/BCCertificateMaker.cs +++ b/src/Titanium.Web.Proxy/Certificates/BCCertificateMaker.cs @@ -162,7 +162,7 @@ private static X509Certificate2 withPrivateKey(X509Certificate certificate, Asym const string password = "password"; Pkcs12Store store; - if(RunTime.IsRunningOnMono) + if (RunTime.IsRunningOnMono) { var builder = new Pkcs12StoreBuilder(); builder.SetUseDerEncoding(true); @@ -172,7 +172,7 @@ private static X509Certificate2 withPrivateKey(X509Certificate certificate, Asym { store = new Pkcs12Store(); } - + var entry = new X509CertificateEntry(certificate); store.SetCertificateEntry(certificate.SubjectDN.ToString(), entry); diff --git a/src/Titanium.Web.Proxy/Network/Certificate/BCCertificateMakerFast.cs b/src/Titanium.Web.Proxy/Certificates/BCCertificateMakerFast.cs similarity index 99% rename from src/Titanium.Web.Proxy/Network/Certificate/BCCertificateMakerFast.cs rename to src/Titanium.Web.Proxy/Certificates/BCCertificateMakerFast.cs index 0ea2ba140..6a7adca57 100644 --- a/src/Titanium.Web.Proxy/Network/Certificate/BCCertificateMakerFast.cs +++ b/src/Titanium.Web.Proxy/Certificates/BCCertificateMakerFast.cs @@ -171,7 +171,7 @@ private static X509Certificate2 withPrivateKey(X509Certificate certificate, Asym const string password = "password"; Pkcs12Store store; - if(RunTime.IsRunningOnMono) + if (RunTime.IsRunningOnMono) { var builder = new Pkcs12StoreBuilder(); builder.SetUseDerEncoding(true); @@ -181,7 +181,7 @@ private static X509Certificate2 withPrivateKey(X509Certificate certificate, Asym { store = new Pkcs12Store(); } - + var entry = new X509CertificateEntry(certificate); store.SetCertificateEntry(certificate.SubjectDN.ToString(), entry); diff --git a/src/Titanium.Web.Proxy/Network/CachedCertificate.cs b/src/Titanium.Web.Proxy/Certificates/CachedCertificate.cs similarity index 98% rename from src/Titanium.Web.Proxy/Network/CachedCertificate.cs rename to src/Titanium.Web.Proxy/Certificates/CachedCertificate.cs index 112b17558..bd4440104 100644 --- a/src/Titanium.Web.Proxy/Network/CachedCertificate.cs +++ b/src/Titanium.Web.Proxy/Certificates/CachedCertificate.cs @@ -12,7 +12,7 @@ public CachedCertificate(X509Certificate2 certificate) { Certificate = certificate; } - + internal X509Certificate2 Certificate { get; } /// diff --git a/src/Titanium.Web.Proxy/Network/CertificateManager.cs b/src/Titanium.Web.Proxy/Certificates/CertificateManager.cs similarity index 99% rename from src/Titanium.Web.Proxy/Network/CertificateManager.cs rename to src/Titanium.Web.Proxy/Certificates/CertificateManager.cs index c11faabf1..a59718587 100644 --- a/src/Titanium.Web.Proxy/Network/CertificateManager.cs +++ b/src/Titanium.Web.Proxy/Certificates/CertificateManager.cs @@ -25,7 +25,7 @@ public enum CertificateEngine BouncyCastle = 0, BouncyCastleFast = 2, - + /// /// Uses Windows Certification Generation API and only valid in Windows OS. /// Observed to be faster than BouncyCastle. diff --git a/src/Titanium.Web.Proxy/Network/DefaultCertificateDiskCache.cs b/src/Titanium.Web.Proxy/Certificates/DefaultCertificateDiskCache.cs similarity index 88% rename from src/Titanium.Web.Proxy/Network/DefaultCertificateDiskCache.cs rename to src/Titanium.Web.Proxy/Certificates/DefaultCertificateDiskCache.cs index 070e71689..910df634e 100644 --- a/src/Titanium.Web.Proxy/Network/DefaultCertificateDiskCache.cs +++ b/src/Titanium.Web.Proxy/Certificates/DefaultCertificateDiskCache.cs @@ -6,13 +6,12 @@ namespace Titanium.Web.Proxy.Network { - internal sealed class DefaultCertificateDiskCache : ICertificateCache + public sealed class DefaultCertificateDiskCache : ICertificateCache { private const string defaultCertificateDirectoryName = "crts"; private const string defaultCertificateFileExtension = ".pfx"; private const string defaultRootCertificateFileName = "rootCert" + defaultCertificateFileExtension; private string? rootCertificatePath; - private string? certificatePath; public X509Certificate2? LoadRootCertificate(string pathOrName, string password, X509KeyStorageFlags storageFlags) { @@ -56,8 +55,6 @@ public void Clear() { // do nothing } - - certificatePath = null; } private X509Certificate2? loadCertificate(string path, string password, X509KeyStorageFlags storageFlags) @@ -95,20 +92,15 @@ private string getRootCertificatePath(string pathOrName) private string getCertificatePath(bool create) { - if (certificatePath == null) - { - string path = getRootCertificateDirectory(); - - string certPath = Path.Combine(path, defaultCertificateDirectoryName); - if (create && !Directory.Exists(certPath)) - { - Directory.CreateDirectory(certPath); - } + string path = getRootCertificateDirectory(); - certificatePath = certPath; + string certPath = Path.Combine(path, defaultCertificateDirectoryName); + if (create && !Directory.Exists(certPath)) + { + Directory.CreateDirectory(certPath); } - return certificatePath; + return certPath; } private string getRootCertificateDirectory() diff --git a/src/Titanium.Web.Proxy/Network/ICertificateCache.cs b/src/Titanium.Web.Proxy/Certificates/ICertificateCache.cs similarity index 100% rename from src/Titanium.Web.Proxy/Network/ICertificateCache.cs rename to src/Titanium.Web.Proxy/Certificates/ICertificateCache.cs diff --git a/src/Titanium.Web.Proxy/Network/Certificate/ICertificateMaker.cs b/src/Titanium.Web.Proxy/Certificates/ICertificateMaker.cs similarity index 100% rename from src/Titanium.Web.Proxy/Network/Certificate/ICertificateMaker.cs rename to src/Titanium.Web.Proxy/Certificates/ICertificateMaker.cs diff --git a/src/Titanium.Web.Proxy/Network/Certificate/WinCertificateMaker.cs b/src/Titanium.Web.Proxy/Certificates/WinCertificateMaker.cs similarity index 100% rename from src/Titanium.Web.Proxy/Network/Certificate/WinCertificateMaker.cs rename to src/Titanium.Web.Proxy/Certificates/WinCertificateMaker.cs diff --git a/src/Titanium.Web.Proxy/Compression/CompressionUtil.cs b/src/Titanium.Web.Proxy/Compression/CompressionUtil.cs index 7cff47098..600c9afb6 100644 --- a/src/Titanium.Web.Proxy/Compression/CompressionUtil.cs +++ b/src/Titanium.Web.Proxy/Compression/CompressionUtil.cs @@ -1,5 +1,4 @@ -using System; -using Titanium.Web.Proxy.Http; +using Titanium.Web.Proxy.Http; namespace Titanium.Web.Proxy.Compression { diff --git a/src/Titanium.Web.Proxy/Compression/HttpCompression.cs b/src/Titanium.Web.Proxy/Compression/HttpCompression.cs index f14fb896e..f54ca4e3e 100644 --- a/src/Titanium.Web.Proxy/Compression/HttpCompression.cs +++ b/src/Titanium.Web.Proxy/Compression/HttpCompression.cs @@ -1,6 +1,4 @@ -using System; - -namespace Titanium.Web.Proxy.Compression +namespace Titanium.Web.Proxy.Compression { internal enum HttpCompression { diff --git a/src/Titanium.Web.Proxy/EventArguments/BeforeSslAuthenticateEventArgs.cs b/src/Titanium.Web.Proxy/EventArguments/BeforeSslAuthenticateEventArgs.cs index be9b0214f..3482061db 100644 --- a/src/Titanium.Web.Proxy/EventArguments/BeforeSslAuthenticateEventArgs.cs +++ b/src/Titanium.Web.Proxy/EventArguments/BeforeSslAuthenticateEventArgs.cs @@ -1,5 +1,4 @@ -using System; -using System.Threading; +using System.Threading; using Titanium.Web.Proxy.Network.Tcp; namespace Titanium.Web.Proxy.EventArguments diff --git a/src/Titanium.Web.Proxy/EventArguments/CertificateSelectionEventArgs.cs b/src/Titanium.Web.Proxy/EventArguments/CertificateSelectionEventArgs.cs index fb9ca4d51..3da92e710 100644 --- a/src/Titanium.Web.Proxy/EventArguments/CertificateSelectionEventArgs.cs +++ b/src/Titanium.Web.Proxy/EventArguments/CertificateSelectionEventArgs.cs @@ -1,5 +1,4 @@ -using System; -using System.Security.Cryptography.X509Certificates; +using System.Security.Cryptography.X509Certificates; namespace Titanium.Web.Proxy.EventArguments { diff --git a/src/Titanium.Web.Proxy/EventArguments/CertificateValidationEventArgs.cs b/src/Titanium.Web.Proxy/EventArguments/CertificateValidationEventArgs.cs index 89ba18bfc..50d2a7d53 100644 --- a/src/Titanium.Web.Proxy/EventArguments/CertificateValidationEventArgs.cs +++ b/src/Titanium.Web.Proxy/EventArguments/CertificateValidationEventArgs.cs @@ -1,5 +1,4 @@ -using System; -using System.Net.Security; +using System.Net.Security; using System.Security.Cryptography.X509Certificates; namespace Titanium.Web.Proxy.EventArguments diff --git a/src/Titanium.Web.Proxy/EventArguments/EmptyProxyEventArgs.cs b/src/Titanium.Web.Proxy/EventArguments/EmptyProxyEventArgs.cs index 81d95d8c0..364c61285 100644 --- a/src/Titanium.Web.Proxy/EventArguments/EmptyProxyEventArgs.cs +++ b/src/Titanium.Web.Proxy/EventArguments/EmptyProxyEventArgs.cs @@ -1,5 +1,4 @@ -using System; -using Titanium.Web.Proxy.Network.Tcp; +using Titanium.Web.Proxy.Network.Tcp; namespace Titanium.Web.Proxy.EventArguments { diff --git a/src/Titanium.Web.Proxy/EventArguments/LimitedStream.cs b/src/Titanium.Web.Proxy/EventArguments/LimitedStream.cs index bef54b944..b525c575e 100644 --- a/src/Titanium.Web.Proxy/EventArguments/LimitedStream.cs +++ b/src/Titanium.Web.Proxy/EventArguments/LimitedStream.cs @@ -20,7 +20,7 @@ internal class LimitedStream : Stream internal LimitedStream(IHttpStreamReader baseStream, IBufferPool bufferPool, bool isChunked, long contentLength) - { + { this.baseReader = baseStream; this.bufferPool = bufferPool; this.isChunked = isChunked; diff --git a/src/Titanium.Web.Proxy/EventArguments/SessionEventArgs.cs b/src/Titanium.Web.Proxy/EventArguments/SessionEventArgs.cs index 5f426155a..278c3ffce 100644 --- a/src/Titanium.Web.Proxy/EventArguments/SessionEventArgs.cs +++ b/src/Titanium.Web.Proxy/EventArguments/SessionEventArgs.cs @@ -25,7 +25,9 @@ public class SessionEventArgs : SessionEventArgsBase /// private bool reRequest; - private WebSocketDecoder? webSocketDecoder; + private WebSocketDecoder? webSocketDecoderSend; + + private WebSocketDecoder? webSocketDecoderReceive; /// /// Is this session a HTTP/2 promise? @@ -59,7 +61,12 @@ public bool ReRequest } } - public WebSocketDecoder WebSocketDecoder => webSocketDecoder ??= new WebSocketDecoder(BufferPool); + [Obsolete("Use [WebSocketDecoderReceive] instead")] + public WebSocketDecoder WebSocketDecoder => WebSocketDecoderReceive; + + public WebSocketDecoder WebSocketDecoderSend => webSocketDecoderSend ??= new WebSocketDecoder(BufferPool); + + public WebSocketDecoder WebSocketDecoderReceive => webSocketDecoderReceive ??= new WebSocketDecoder(BufferPool); /// /// Occurs when multipart request part sent. @@ -588,7 +595,7 @@ public void Respond(Response response, bool closeServerConnection = false) { HttpClient.Request.Locked = true; HttpClient.Request.CancelRequest = true; - + // set new response. HttpClient.Response = response; HttpClient.Response.Locked = true; diff --git a/src/Titanium.Web.Proxy/Extensions/StreamExtensions.cs b/src/Titanium.Web.Proxy/Extensions/StreamExtensions.cs index bbe52459b..e34c577b9 100644 --- a/src/Titanium.Web.Proxy/Extensions/StreamExtensions.cs +++ b/src/Titanium.Web.Proxy/Extensions/StreamExtensions.cs @@ -62,7 +62,7 @@ internal static async Task CopyToAsync(this Stream input, Stream output, Action< } } - internal static async Task WithCancellation(this Task task, CancellationToken cancellationToken) where T : struct + internal static async Task WithCancellation(this Task task, CancellationToken cancellationToken) where T : struct { var tcs = new TaskCompletionSource(); using (cancellationToken.Register(s => ((TaskCompletionSource)s).TrySetResult(true), tcs)) diff --git a/src/Titanium.Web.Proxy/Extensions/TcpExtensions.cs b/src/Titanium.Web.Proxy/Extensions/TcpExtensions.cs index 4e7a41aea..4c0c723f7 100644 --- a/src/Titanium.Web.Proxy/Extensions/TcpExtensions.cs +++ b/src/Titanium.Web.Proxy/Extensions/TcpExtensions.cs @@ -1,5 +1,4 @@ -using System; -using System.Net.Sockets; +using System.Net.Sockets; namespace Titanium.Web.Proxy.Extensions { diff --git a/src/Titanium.Web.Proxy/Helpers/HttpClientStream.cs b/src/Titanium.Web.Proxy/Helpers/HttpClientStream.cs index 594635e36..7a13157e8 100644 --- a/src/Titanium.Web.Proxy/Helpers/HttpClientStream.cs +++ b/src/Titanium.Web.Proxy/Helpers/HttpClientStream.cs @@ -1,5 +1,4 @@ -using System; -using System.IO; +using System.IO; using System.Threading; using System.Threading.Tasks; using Titanium.Web.Proxy.Http; @@ -12,7 +11,7 @@ internal sealed class HttpClientStream : HttpStream { 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) { Connection = connection; @@ -27,10 +26,10 @@ internal HttpClientStream(TcpClientConnection connection, Stream stream, IBuffer internal async ValueTask WriteResponseAsync(Response response, CancellationToken cancellationToken = default) { var headerBuilder = new HeaderBuilder(); - + // Write back response status to client headerBuilder.WriteResponseLine(response.HttpVersion, response.StatusCode, response.StatusDescription); - + await WriteAsync(response, headerBuilder, cancellationToken); } diff --git a/src/Titanium.Web.Proxy/Helpers/HttpStream.cs b/src/Titanium.Web.Proxy/Helpers/HttpStream.cs index 3cafc39a7..06c7aa844 100644 --- a/src/Titanium.Web.Proxy/Helpers/HttpStream.cs +++ b/src/Titanium.Web.Proxy/Helpers/HttpStream.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; 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.Models; @@ -1017,7 +1018,7 @@ public async Task CopyBodyAsync(RequestResponseBase requestResponse, bool useOri string? contentEncoding = useOriginalHeaderValues ? requestResponse.OriginalContentEncoding : requestResponse.ContentEncoding; Stream s = limitedStream = new LimitedStream(this, bufferPool, isChunked, contentLength); - + if (transformation == TransformationMode.Uncompress && contentEncoding != null) { s = decompressStream = DecompressionFactory.Create(CompressionUtil.CompressionNameToEnum(contentEncoding), s); @@ -1102,13 +1103,16 @@ private async Task copyBodyChunkedAsync(IHttpStreamWriter writer, Action= 0) { chunkHead = chunkHead.Substring(0, idx); } - int chunkSize = int.Parse(chunkHead, NumberStyles.HexNumber); + if (!int.TryParse(chunkHead, NumberStyles.HexNumber, null, out int chunkSize)) + { + throw new ProxyHttpException($"Invalid chunk length: '{chunkHead}'", null, null); + } await writer.WriteLineAsync(chunkHead, cancellationToken); diff --git a/src/Titanium.Web.Proxy/Helpers/KnownMethod.cs b/src/Titanium.Web.Proxy/Helpers/KnownMethod.cs index eda343753..c22377a15 100644 --- a/src/Titanium.Web.Proxy/Helpers/KnownMethod.cs +++ b/src/Titanium.Web.Proxy/Helpers/KnownMethod.cs @@ -43,7 +43,7 @@ internal enum KnownMethod // RFC 4437: Web Distributed Authoring and Versioning (WebDAV): Redirect Reference Resources Mkredirectref, Updateredirectref, - + // RFC 4791: Calendaring Extensions to WebDAV (CalDAV) Mkcalendar, diff --git a/src/Titanium.Web.Proxy/Net45Compatibility.cs b/src/Titanium.Web.Proxy/Helpers/Net45Compatibility.cs similarity index 72% rename from src/Titanium.Web.Proxy/Net45Compatibility.cs rename to src/Titanium.Web.Proxy/Helpers/Net45Compatibility.cs index 834996452..e183d8fde 100644 --- a/src/Titanium.Web.Proxy/Net45Compatibility.cs +++ b/src/Titanium.Web.Proxy/Helpers/Net45Compatibility.cs @@ -8,7 +8,7 @@ class Net45Compatibility { public static byte[] EmptyArray = new byte[0]; - public static Task CompletedTask = new Task(() => { }); + public static Task CompletedTask = Task.FromResult(null); } } #endif diff --git a/src/Titanium.Web.Proxy/Helpers/Network.cs b/src/Titanium.Web.Proxy/Helpers/Network.cs index 93d04eb90..8402ccd1e 100644 --- a/src/Titanium.Web.Proxy/Helpers/Network.cs +++ b/src/Titanium.Web.Proxy/Helpers/Network.cs @@ -53,7 +53,7 @@ internal static bool IsLocalIpAddress(string hostName) } try - { + { // do reverse DNS lookup even if hostName is an IP address var hostEntry = Dns.GetHostEntry(hostName); // if DNS resolved hostname matches local DNS name, diff --git a/src/Titanium.Web.Proxy/Helpers/NullWriter.cs b/src/Titanium.Web.Proxy/Helpers/NullWriter.cs index 55ac32b5b..b71892846 100644 --- a/src/Titanium.Web.Proxy/Helpers/NullWriter.cs +++ b/src/Titanium.Web.Proxy/Helpers/NullWriter.cs @@ -19,7 +19,7 @@ public void Write(byte[] buffer, int offset, int count) public Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) { #if NET45 - return Net45Compatibility.CompletedTask; + return Net45Compatibility.CompletedTask; #else return Task.CompletedTask; #endif diff --git a/src/Titanium.Web.Proxy/Helpers/RunTime.cs b/src/Titanium.Web.Proxy/Helpers/RunTime.cs index 3660098bc..720f27a0a 100644 --- a/src/Titanium.Web.Proxy/Helpers/RunTime.cs +++ b/src/Titanium.Web.Proxy/Helpers/RunTime.cs @@ -1,8 +1,8 @@ using System; using System.Reflection; -using System.Text; using System.Runtime.InteropServices; using System.Runtime.Versioning; +using System.Text; namespace Titanium.Web.Proxy.Helpers { @@ -63,7 +63,7 @@ public static class RunTime public static bool IsUwpOnWindows => IsWindows && UwpHelper.IsRunningAsUwp(); public static bool IsMac => isRunningOnMac; - + /// /// Is socket reuse available to use? /// diff --git a/src/Titanium.Web.Proxy/Helpers/SystemProxy.cs b/src/Titanium.Web.Proxy/Helpers/SystemProxy.cs index c9c3f32b3..f750b4b36 100644 --- a/src/Titanium.Web.Proxy/Helpers/SystemProxy.cs +++ b/src/Titanium.Web.Proxy/Helpers/SystemProxy.cs @@ -345,9 +345,9 @@ private static void refresh() /// /// Opens the registry key with the internet settings /// - private static RegistryKey openInternetSettingsKey() + private static RegistryKey? openInternetSettingsKey() { - return Registry.CurrentUser.OpenSubKey(regKeyInternetSettings, true); + return Registry.CurrentUser?.OpenSubKey(regKeyInternetSettings, true); } } } diff --git a/src/Titanium.Web.Proxy/Helpers/TcpHelper.cs b/src/Titanium.Web.Proxy/Helpers/TcpHelper.cs index 187f5cd9f..97e80301f 100644 --- a/src/Titanium.Web.Proxy/Helpers/TcpHelper.cs +++ b/src/Titanium.Web.Proxy/Helpers/TcpHelper.cs @@ -130,7 +130,7 @@ private static async Task sendRawTap(Stream clientStream, Stream serverStream, I /// /// /// - internal static Task SendRaw(Stream clientStream, Stream serverStream, IBufferPool bufferPool, + internal static Task SendRaw(Stream clientStream, Stream serverStream, IBufferPool bufferPool, Action? onDataSend, Action? onDataReceive, CancellationTokenSource cancellationTokenSource, ExceptionHandler exceptionFunc) diff --git a/src/Titanium.Web.Proxy/Http/ConnectRequest.cs b/src/Titanium.Web.Proxy/Http/ConnectRequest.cs index 3267105d0..338e27c5b 100644 --- a/src/Titanium.Web.Proxy/Http/ConnectRequest.cs +++ b/src/Titanium.Web.Proxy/Http/ConnectRequest.cs @@ -1,5 +1,4 @@ -using System; -using Titanium.Web.Proxy.Models; +using Titanium.Web.Proxy.Models; using Titanium.Web.Proxy.StreamExtended; namespace Titanium.Web.Proxy.Http diff --git a/src/Titanium.Web.Proxy/Http/HttpWebClient.cs b/src/Titanium.Web.Proxy/Http/HttpWebClient.cs index c8e7846da..c7892d842 100644 --- a/src/Titanium.Web.Proxy/Http/HttpWebClient.cs +++ b/src/Titanium.Web.Proxy/Http/HttpWebClient.cs @@ -145,7 +145,7 @@ internal async Task SendRequest(bool enable100ContinueBehaviour, bool isTranspar { url = "/"; } - + // prepare the request & headers var headerBuilder = new HeaderBuilder(); headerBuilder.WriteRequestLine(Request.Method, url, Request.HttpVersion); diff --git a/src/Titanium.Web.Proxy/Http/RequestResponseBase.cs b/src/Titanium.Web.Proxy/Http/RequestResponseBase.cs index e46888910..825cc8db8 100644 --- a/src/Titanium.Web.Proxy/Http/RequestResponseBase.cs +++ b/src/Titanium.Web.Proxy/Http/RequestResponseBase.cs @@ -210,7 +210,7 @@ internal set internal bool Locked { get; set; } internal bool BodyAvailable => BodyInternal != null; - + internal bool IsBodySent { get; set; } internal abstract void EnsureBodyAvailable(bool throwWhenNotReadYet = true); diff --git a/src/Titanium.Web.Proxy/Http2/Hpack/Encoder.cs b/src/Titanium.Web.Proxy/Http2/Hpack/Encoder.cs index 07081c769..9c88a4d57 100644 --- a/src/Titanium.Web.Proxy/Http2/Hpack/Encoder.cs +++ b/src/Titanium.Web.Proxy/Http2/Hpack/Encoder.cs @@ -103,7 +103,7 @@ public void EncodeHeader(BinaryWriter output, ByteString name, ByteString value, if (headerField != null) { int index = getIndex(headerField.Index) + StaticTable.Length; - + // Section 6.1. Indexed Header Field Representation encodeInteger(output, 0x80, 7, index); } diff --git a/src/Titanium.Web.Proxy/Http2/Hpack/HpackUtil.cs b/src/Titanium.Web.Proxy/Http2/Hpack/HpackUtil.cs index 5cab1965e..d6a949e3f 100644 --- a/src/Titanium.Web.Proxy/Http2/Hpack/HpackUtil.cs +++ b/src/Titanium.Web.Proxy/Http2/Hpack/HpackUtil.cs @@ -15,302 +15,300 @@ * limitations under the License. */ -using System; - namespace Titanium.Web.Proxy.Http2.Hpack { - public static class HpackUtil - { - // Section 6.2. Literal Header Field Representation - public enum IndexType - { - Incremental, // Section 6.2.1. Literal Header Field with Incremental Indexing - None, // Section 6.2.2. Literal Header Field without Indexing - Never // Section 6.2.3. Literal Header Field never Indexed - } + public static class HpackUtil + { + // Section 6.2. Literal Header Field Representation + public enum IndexType + { + Incremental, // Section 6.2.1. Literal Header Field with Incremental Indexing + None, // Section 6.2.2. Literal Header Field without Indexing + Never // Section 6.2.3. Literal Header Field never Indexed + } - // Appendix B: Huffman Codes - // http://tools.ietf.org/html/rfc7541#appendix-B - public static readonly int[] HuffmanCodes = { - 0x1ff8, - 0x7fffd8, - 0xfffffe2, - 0xfffffe3, - 0xfffffe4, - 0xfffffe5, - 0xfffffe6, - 0xfffffe7, - 0xfffffe8, - 0xffffea, - 0x3ffffffc, - 0xfffffe9, - 0xfffffea, - 0x3ffffffd, - 0xfffffeb, - 0xfffffec, - 0xfffffed, - 0xfffffee, - 0xfffffef, - 0xffffff0, - 0xffffff1, - 0xffffff2, - 0x3ffffffe, - 0xffffff3, - 0xffffff4, - 0xffffff5, - 0xffffff6, - 0xffffff7, - 0xffffff8, - 0xffffff9, - 0xffffffa, - 0xffffffb, - 0x14, - 0x3f8, - 0x3f9, - 0xffa, - 0x1ff9, - 0x15, - 0xf8, - 0x7fa, - 0x3fa, - 0x3fb, - 0xf9, - 0x7fb, - 0xfa, - 0x16, - 0x17, - 0x18, - 0x0, - 0x1, - 0x2, - 0x19, - 0x1a, - 0x1b, - 0x1c, - 0x1d, - 0x1e, - 0x1f, - 0x5c, - 0xfb, - 0x7ffc, - 0x20, - 0xffb, - 0x3fc, - 0x1ffa, - 0x21, - 0x5d, - 0x5e, - 0x5f, - 0x60, - 0x61, - 0x62, - 0x63, - 0x64, - 0x65, - 0x66, - 0x67, - 0x68, - 0x69, - 0x6a, - 0x6b, - 0x6c, - 0x6d, - 0x6e, - 0x6f, - 0x70, - 0x71, - 0x72, - 0xfc, - 0x73, - 0xfd, - 0x1ffb, - 0x7fff0, - 0x1ffc, - 0x3ffc, - 0x22, - 0x7ffd, - 0x3, - 0x23, - 0x4, - 0x24, - 0x5, - 0x25, - 0x26, - 0x27, - 0x6, - 0x74, - 0x75, - 0x28, - 0x29, - 0x2a, - 0x7, - 0x2b, - 0x76, - 0x2c, - 0x8, - 0x9, - 0x2d, - 0x77, - 0x78, - 0x79, - 0x7a, - 0x7b, - 0x7ffe, - 0x7fc, - 0x3ffd, - 0x1ffd, - 0xffffffc, - 0xfffe6, - 0x3fffd2, - 0xfffe7, - 0xfffe8, - 0x3fffd3, - 0x3fffd4, - 0x3fffd5, - 0x7fffd9, - 0x3fffd6, - 0x7fffda, - 0x7fffdb, - 0x7fffdc, - 0x7fffdd, - 0x7fffde, - 0xffffeb, - 0x7fffdf, - 0xffffec, - 0xffffed, - 0x3fffd7, - 0x7fffe0, - 0xffffee, - 0x7fffe1, - 0x7fffe2, - 0x7fffe3, - 0x7fffe4, - 0x1fffdc, - 0x3fffd8, - 0x7fffe5, - 0x3fffd9, - 0x7fffe6, - 0x7fffe7, - 0xffffef, - 0x3fffda, - 0x1fffdd, - 0xfffe9, - 0x3fffdb, - 0x3fffdc, - 0x7fffe8, - 0x7fffe9, - 0x1fffde, - 0x7fffea, - 0x3fffdd, - 0x3fffde, - 0xfffff0, - 0x1fffdf, - 0x3fffdf, - 0x7fffeb, - 0x7fffec, - 0x1fffe0, - 0x1fffe1, - 0x3fffe0, - 0x1fffe2, - 0x7fffed, - 0x3fffe1, - 0x7fffee, - 0x7fffef, - 0xfffea, - 0x3fffe2, - 0x3fffe3, - 0x3fffe4, - 0x7ffff0, - 0x3fffe5, - 0x3fffe6, - 0x7ffff1, - 0x3ffffe0, - 0x3ffffe1, - 0xfffeb, - 0x7fff1, - 0x3fffe7, - 0x7ffff2, - 0x3fffe8, - 0x1ffffec, - 0x3ffffe2, - 0x3ffffe3, - 0x3ffffe4, - 0x7ffffde, - 0x7ffffdf, - 0x3ffffe5, - 0xfffff1, - 0x1ffffed, - 0x7fff2, - 0x1fffe3, - 0x3ffffe6, - 0x7ffffe0, - 0x7ffffe1, - 0x3ffffe7, - 0x7ffffe2, - 0xfffff2, - 0x1fffe4, - 0x1fffe5, - 0x3ffffe8, - 0x3ffffe9, - 0xffffffd, - 0x7ffffe3, - 0x7ffffe4, - 0x7ffffe5, - 0xfffec, - 0xfffff3, - 0xfffed, - 0x1fffe6, - 0x3fffe9, - 0x1fffe7, - 0x1fffe8, - 0x7ffff3, - 0x3fffea, - 0x3fffeb, - 0x1ffffee, - 0x1ffffef, - 0xfffff4, - 0xfffff5, - 0x3ffffea, - 0x7ffff4, - 0x3ffffeb, - 0x7ffffe6, - 0x3ffffec, - 0x3ffffed, - 0x7ffffe7, - 0x7ffffe8, - 0x7ffffe9, - 0x7ffffea, - 0x7ffffeb, - 0xffffffe, - 0x7ffffec, - 0x7ffffed, - 0x7ffffee, - 0x7ffffef, - 0x7fffff0, - 0x3ffffee, - 0x3fffffff // EOS + // Appendix B: Huffman Codes + // http://tools.ietf.org/html/rfc7541#appendix-B + public static readonly int[] HuffmanCodes = { + 0x1ff8, + 0x7fffd8, + 0xfffffe2, + 0xfffffe3, + 0xfffffe4, + 0xfffffe5, + 0xfffffe6, + 0xfffffe7, + 0xfffffe8, + 0xffffea, + 0x3ffffffc, + 0xfffffe9, + 0xfffffea, + 0x3ffffffd, + 0xfffffeb, + 0xfffffec, + 0xfffffed, + 0xfffffee, + 0xfffffef, + 0xffffff0, + 0xffffff1, + 0xffffff2, + 0x3ffffffe, + 0xffffff3, + 0xffffff4, + 0xffffff5, + 0xffffff6, + 0xffffff7, + 0xffffff8, + 0xffffff9, + 0xffffffa, + 0xffffffb, + 0x14, + 0x3f8, + 0x3f9, + 0xffa, + 0x1ff9, + 0x15, + 0xf8, + 0x7fa, + 0x3fa, + 0x3fb, + 0xf9, + 0x7fb, + 0xfa, + 0x16, + 0x17, + 0x18, + 0x0, + 0x1, + 0x2, + 0x19, + 0x1a, + 0x1b, + 0x1c, + 0x1d, + 0x1e, + 0x1f, + 0x5c, + 0xfb, + 0x7ffc, + 0x20, + 0xffb, + 0x3fc, + 0x1ffa, + 0x21, + 0x5d, + 0x5e, + 0x5f, + 0x60, + 0x61, + 0x62, + 0x63, + 0x64, + 0x65, + 0x66, + 0x67, + 0x68, + 0x69, + 0x6a, + 0x6b, + 0x6c, + 0x6d, + 0x6e, + 0x6f, + 0x70, + 0x71, + 0x72, + 0xfc, + 0x73, + 0xfd, + 0x1ffb, + 0x7fff0, + 0x1ffc, + 0x3ffc, + 0x22, + 0x7ffd, + 0x3, + 0x23, + 0x4, + 0x24, + 0x5, + 0x25, + 0x26, + 0x27, + 0x6, + 0x74, + 0x75, + 0x28, + 0x29, + 0x2a, + 0x7, + 0x2b, + 0x76, + 0x2c, + 0x8, + 0x9, + 0x2d, + 0x77, + 0x78, + 0x79, + 0x7a, + 0x7b, + 0x7ffe, + 0x7fc, + 0x3ffd, + 0x1ffd, + 0xffffffc, + 0xfffe6, + 0x3fffd2, + 0xfffe7, + 0xfffe8, + 0x3fffd3, + 0x3fffd4, + 0x3fffd5, + 0x7fffd9, + 0x3fffd6, + 0x7fffda, + 0x7fffdb, + 0x7fffdc, + 0x7fffdd, + 0x7fffde, + 0xffffeb, + 0x7fffdf, + 0xffffec, + 0xffffed, + 0x3fffd7, + 0x7fffe0, + 0xffffee, + 0x7fffe1, + 0x7fffe2, + 0x7fffe3, + 0x7fffe4, + 0x1fffdc, + 0x3fffd8, + 0x7fffe5, + 0x3fffd9, + 0x7fffe6, + 0x7fffe7, + 0xffffef, + 0x3fffda, + 0x1fffdd, + 0xfffe9, + 0x3fffdb, + 0x3fffdc, + 0x7fffe8, + 0x7fffe9, + 0x1fffde, + 0x7fffea, + 0x3fffdd, + 0x3fffde, + 0xfffff0, + 0x1fffdf, + 0x3fffdf, + 0x7fffeb, + 0x7fffec, + 0x1fffe0, + 0x1fffe1, + 0x3fffe0, + 0x1fffe2, + 0x7fffed, + 0x3fffe1, + 0x7fffee, + 0x7fffef, + 0xfffea, + 0x3fffe2, + 0x3fffe3, + 0x3fffe4, + 0x7ffff0, + 0x3fffe5, + 0x3fffe6, + 0x7ffff1, + 0x3ffffe0, + 0x3ffffe1, + 0xfffeb, + 0x7fff1, + 0x3fffe7, + 0x7ffff2, + 0x3fffe8, + 0x1ffffec, + 0x3ffffe2, + 0x3ffffe3, + 0x3ffffe4, + 0x7ffffde, + 0x7ffffdf, + 0x3ffffe5, + 0xfffff1, + 0x1ffffed, + 0x7fff2, + 0x1fffe3, + 0x3ffffe6, + 0x7ffffe0, + 0x7ffffe1, + 0x3ffffe7, + 0x7ffffe2, + 0xfffff2, + 0x1fffe4, + 0x1fffe5, + 0x3ffffe8, + 0x3ffffe9, + 0xffffffd, + 0x7ffffe3, + 0x7ffffe4, + 0x7ffffe5, + 0xfffec, + 0xfffff3, + 0xfffed, + 0x1fffe6, + 0x3fffe9, + 0x1fffe7, + 0x1fffe8, + 0x7ffff3, + 0x3fffea, + 0x3fffeb, + 0x1ffffee, + 0x1ffffef, + 0xfffff4, + 0xfffff5, + 0x3ffffea, + 0x7ffff4, + 0x3ffffeb, + 0x7ffffe6, + 0x3ffffec, + 0x3ffffed, + 0x7ffffe7, + 0x7ffffe8, + 0x7ffffe9, + 0x7ffffea, + 0x7ffffeb, + 0xffffffe, + 0x7ffffec, + 0x7ffffed, + 0x7ffffee, + 0x7ffffef, + 0x7fffff0, + 0x3ffffee, + 0x3fffffff // EOS }; - public static readonly byte[] HuffmanCodeLengths = { - 13, 23, 28, 28, 28, 28, 28, 28, 28, 24, 30, 28, 28, 30, 28, 28, - 28, 28, 28, 28, 28, 28, 30, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 6, 10, 10, 12, 13, 6, 8, 11, 10, 10, 8, 11, 8, 6, 6, 6, - 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 8, 15, 6, 12, 10, - 13, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 8, 7, 8, 13, 19, 13, 14, 6, - 15, 5, 6, 5, 6, 5, 6, 6, 6, 5, 7, 7, 6, 6, 6, 5, - 6, 7, 6, 5, 5, 6, 7, 7, 7, 7, 7, 15, 11, 14, 13, 28, - 20, 22, 20, 20, 22, 22, 22, 23, 22, 23, 23, 23, 23, 23, 24, 23, - 24, 24, 22, 23, 24, 23, 23, 23, 23, 21, 22, 23, 22, 23, 23, 24, - 22, 21, 20, 22, 22, 23, 23, 21, 23, 22, 22, 24, 21, 22, 23, 23, - 21, 21, 22, 21, 23, 22, 23, 23, 20, 22, 22, 22, 23, 22, 22, 23, - 26, 26, 20, 19, 22, 23, 22, 25, 26, 26, 26, 27, 27, 26, 24, 25, - 19, 21, 26, 27, 27, 26, 27, 24, 21, 21, 26, 26, 28, 27, 27, 27, - 20, 24, 20, 21, 22, 21, 21, 23, 22, 22, 25, 25, 24, 24, 26, 23, - 26, 27, 26, 26, 27, 27, 27, 27, 27, 28, 27, 27, 27, 27, 27, 26, - 30 // EOS + public static readonly byte[] HuffmanCodeLengths = { + 13, 23, 28, 28, 28, 28, 28, 28, 28, 24, 30, 28, 28, 30, 28, 28, + 28, 28, 28, 28, 28, 28, 30, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 6, 10, 10, 12, 13, 6, 8, 11, 10, 10, 8, 11, 8, 6, 6, 6, + 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 8, 15, 6, 12, 10, + 13, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 8, 7, 8, 13, 19, 13, 14, 6, + 15, 5, 6, 5, 6, 5, 6, 6, 6, 5, 7, 7, 6, 6, 6, 5, + 6, 7, 6, 5, 5, 6, 7, 7, 7, 7, 7, 15, 11, 14, 13, 28, + 20, 22, 20, 20, 22, 22, 22, 23, 22, 23, 23, 23, 23, 23, 24, 23, + 24, 24, 22, 23, 24, 23, 23, 23, 23, 21, 22, 23, 22, 23, 23, 24, + 22, 21, 20, 22, 22, 23, 23, 21, 23, 22, 22, 24, 21, 22, 23, 23, + 21, 21, 22, 21, 23, 22, 23, 23, 20, 22, 22, 22, 23, 22, 22, 23, + 26, 26, 20, 19, 22, 23, 22, 25, 26, 26, 26, 27, 27, 26, 24, 25, + 19, 21, 26, 27, 27, 26, 27, 24, 21, 21, 26, 26, 28, 27, 27, 27, + 20, 24, 20, 21, 22, 21, 21, 23, 22, 22, 25, 25, 24, 24, 26, 23, + 26, 27, 26, 26, 27, 27, 27, 27, 27, 28, 27, 27, 27, 27, 27, 26, + 30 // EOS }; - public const int HuffmanEos = 256; - } + public const int HuffmanEos = 256; + } } diff --git a/src/Titanium.Web.Proxy/Http2/Hpack/IHeaderListener.cs b/src/Titanium.Web.Proxy/Http2/Hpack/IHeaderListener.cs index bdf26b6ab..b72c4a2d5 100644 --- a/src/Titanium.Web.Proxy/Http2/Hpack/IHeaderListener.cs +++ b/src/Titanium.Web.Proxy/Http2/Hpack/IHeaderListener.cs @@ -15,20 +15,19 @@ * limitations under the License. */ -using System; using Titanium.Web.Proxy.Models; namespace Titanium.Web.Proxy.Http2.Hpack { - internal interface IHeaderListener - { - /// - /// EmitHeader is called by the decoder during header field emission. - /// The name and value byte arrays must not be modified. - /// - /// Name. - /// Value. - /// If set to true sensitive. - void AddHeader(ByteString name, ByteString value, bool sensitive); - } + internal interface IHeaderListener + { + /// + /// EmitHeader is called by the decoder during header field emission. + /// The name and value byte arrays must not be modified. + /// + /// Name. + /// Value. + /// If set to true sensitive. + void AddHeader(ByteString name, ByteString value, bool sensitive); + } } diff --git a/src/Titanium.Web.Proxy/Http2/Hpack/StaticTable.cs b/src/Titanium.Web.Proxy/Http2/Hpack/StaticTable.cs index 49906e9d2..3cb0ff0d3 100644 --- a/src/Titanium.Web.Proxy/Http2/Hpack/StaticTable.cs +++ b/src/Titanium.Web.Proxy/Http2/Hpack/StaticTable.cs @@ -15,7 +15,6 @@ * limitations under the License. */ -using System; using System.Collections.Generic; using Titanium.Web.Proxy.Models; @@ -32,7 +31,7 @@ internal static class StaticTable private static readonly Dictionary staticIndexByName; public static ByteString KnownHeaderAuhtority = (ByteString)":authority"; - + public static ByteString KnownHeaderMethod = (ByteString)":method"; public static ByteString KnownHeaderPath = (ByteString)":path"; @@ -109,11 +108,11 @@ static StaticTable() create("WWW-Authenticate", string.Empty); // 61 } - /// - /// The number of header fields in the static table. - /// - /// The length. - public static int Length => staticTable.Count; + /// + /// The number of header fields in the static table. + /// + /// The length. + public static int Length => staticTable.Count; /// /// Return the http header field at the given index value. diff --git a/src/Titanium.Web.Proxy/Http2/Http2Helper.cs b/src/Titanium.Web.Proxy/Http2/Http2Helper.cs index 2dbcc5d7a..d84341874 100644 --- a/src/Titanium.Web.Proxy/Http2/Http2Helper.cs +++ b/src/Titanium.Web.Proxy/Http2/Http2Helper.cs @@ -43,12 +43,12 @@ internal static async Task SendHttp2(Stream clientStream, Stream serverStream, // Now async relay all server=>client & client=>server data var sendRelay = - copyHttp2FrameAsync(clientStream, serverStream, clientSettings, serverSettings, - sessionFactory, sessions, onBeforeRequest, + copyHttp2FrameAsync(clientStream, serverStream, clientSettings, serverSettings, + sessionFactory, sessions, onBeforeRequest, connectionId, true, cancellationTokenSource.Token, exceptionFunc); var receiveRelay = - copyHttp2FrameAsync(serverStream, clientStream, serverSettings, clientSettings, - sessionFactory, sessions, onBeforeResponse, + copyHttp2FrameAsync(serverStream, clientStream, serverSettings, clientSettings, + sessionFactory, sessions, onBeforeResponse, connectionId, false, cancellationTokenSource.Token, exceptionFunc); await Task.WhenAny(sendRelay, receiveRelay); @@ -59,7 +59,7 @@ internal static async Task SendHttp2(Stream clientStream, Stream serverStream, private static async Task copyHttp2FrameAsync(Stream input, Stream output, Http2Settings localSettings, Http2Settings remoteSettings, - Func sessionFactory, ConcurrentDictionary sessions, + Func sessionFactory, ConcurrentDictionary sessions, Func onBeforeRequestResponse, Guid connectionId, bool isClient, CancellationToken cancellationToken, ExceptionHandler exceptionFunc) @@ -81,7 +81,7 @@ private static async Task copyHttp2FrameAsync(Stream input, Stream output, int length = (frameHeaderBuffer[0] << 16) + (frameHeaderBuffer[1] << 8) + frameHeaderBuffer[2]; var type = (Http2FrameType)frameHeaderBuffer[3]; 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]; frameHeader.Length = length; @@ -129,7 +129,7 @@ private static async Task copyHttp2FrameAsync(Stream input, Stream output, //System.Diagnostics.Debug.WriteLine("CONN: " + connectionId + ", CLIENT: " + isClient + ", STREAM: " + streamId + ", TYPE: " + type); if (type == Http2FrameType.Data && args != null) { - if (isClient) + if (isClient) args.OnDataSent(buffer, 0, read); else args.OnDataReceived(buffer, 0, read); diff --git a/src/Titanium.Web.Proxy/Models/ExternalProxy.cs b/src/Titanium.Web.Proxy/Models/ExternalProxy.cs index 3f09aee62..f93187507 100644 --- a/src/Titanium.Web.Proxy/Models/ExternalProxy.cs +++ b/src/Titanium.Web.Proxy/Models/ExternalProxy.cs @@ -85,7 +85,7 @@ public ExternalProxy() /// The port. public ExternalProxy(string hostName, int port) { - HostName = hostName; + HostName = hostName; Port = port; } @@ -115,7 +115,7 @@ public override string ToString() } public enum ExternalProxyType - { + { /// A HTTP/HTTPS proxy server. Http, diff --git a/src/Titanium.Web.Proxy/Models/HttpHeader.cs b/src/Titanium.Web.Proxy/Models/HttpHeader.cs index 203200321..31cd0b9ba 100644 --- a/src/Titanium.Web.Proxy/Models/HttpHeader.cs +++ b/src/Titanium.Web.Proxy/Models/HttpHeader.cs @@ -58,7 +58,7 @@ public HttpHeader(string name, string value) nameString = name.Trim(); NameData = nameString.GetByteString(); - + valueString = value.Trim(); ValueData = valueString.GetByteString(); } diff --git a/src/Titanium.Web.Proxy/Models/TransparentBaseProxyEndPoint.cs b/src/Titanium.Web.Proxy/Models/TransparentBaseProxyEndPoint.cs index a3bd80780..70a7153a3 100644 --- a/src/Titanium.Web.Proxy/Models/TransparentBaseProxyEndPoint.cs +++ b/src/Titanium.Web.Proxy/Models/TransparentBaseProxyEndPoint.cs @@ -1,5 +1,4 @@ -using System; -using System.Net; +using System.Net; using System.Threading.Tasks; using Titanium.Web.Proxy.EventArguments; diff --git a/src/Titanium.Web.Proxy/Network/RetryPolicy.cs b/src/Titanium.Web.Proxy/Network/RetryPolicy.cs index 7e6a824de..a2f724554 100644 --- a/src/Titanium.Web.Proxy/Network/RetryPolicy.cs +++ b/src/Titanium.Web.Proxy/Network/RetryPolicy.cs @@ -45,7 +45,7 @@ internal async Task ExecuteAsync(Func ExecuteAsync(Func createServerConnection(string remoteHost proxySocket.ProxyUser = externalProxy.UserName; proxySocket.ProxyPass = externalProxy.Password; } - + tcpServerSocket = proxySocket; } else @@ -744,7 +744,7 @@ 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); diff --git a/src/Titanium.Web.Proxy/Network/Tcp/TcpServerConnection.cs b/src/Titanium.Web.Proxy/Network/Tcp/TcpServerConnection.cs index a413ee1fa..abd71523d 100644 --- a/src/Titanium.Web.Proxy/Network/Tcp/TcpServerConnection.cs +++ b/src/Titanium.Web.Proxy/Network/Tcp/TcpServerConnection.cs @@ -97,7 +97,7 @@ public void Dispose() await Task.Delay(1000); proxyServer.UpdateServerConnectionCount(false); Stream.Dispose(); - + try { TcpSocket.Close(); diff --git a/src/Titanium.Web.Proxy/Network/WinAuth/Security/WinAuthEndPoint.cs b/src/Titanium.Web.Proxy/Network/WinAuth/Security/WinAuthEndPoint.cs index fabd4470b..5fa0df535 100644 --- a/src/Titanium.Web.Proxy/Network/WinAuth/Security/WinAuthEndPoint.cs +++ b/src/Titanium.Web.Proxy/Network/WinAuth/Security/WinAuthEndPoint.cs @@ -61,7 +61,7 @@ internal class WinAuthEndPoint out clientToken, out NewContextAttributes, out NewLifeTime); - + if (result != IntermediateResult) { return null; diff --git a/src/Titanium.Web.Proxy/Properties/AssemblyInfo.cs b/src/Titanium.Web.Proxy/Properties/AssemblyInfo.cs index 3ab205919..1432bcfad 100644 --- a/src/Titanium.Web.Proxy/Properties/AssemblyInfo.cs +++ b/src/Titanium.Web.Proxy/Properties/AssemblyInfo.cs @@ -1,4 +1,4 @@ -using System.Reflection; +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -11,7 +11,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Titanium.Web.Proxy")] -[assembly: AssemblyCopyright("Copyright © Titanium 2015-2019")] +[assembly: AssemblyCopyright("Copyright © Titanium 2015-2020")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: InternalsVisibleTo("Titanium.Web.Proxy.UnitTests, PublicKey=" + diff --git a/src/Titanium.Web.Proxy/ProxyAuthorizationHandler.cs b/src/Titanium.Web.Proxy/ProxyAuthorizationHandler.cs index 9712be8b2..4bbcbd751 100644 --- a/src/Titanium.Web.Proxy/ProxyAuthorizationHandler.cs +++ b/src/Titanium.Web.Proxy/ProxyAuthorizationHandler.cs @@ -156,7 +156,7 @@ private Response createContinuationResponse(Response response, string continuati response.Headers.AddHeader(KnownHeaders.ProxyAuthenticate, continuation); response.Headers.AddHeader(KnownHeaders.ProxyConnection, KnownHeaders.ConnectionKeepAlive); - + response.Headers.FixProxyHeaders(); return response; diff --git a/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthNone.cs b/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthNone.cs index 94df7d57b..726facc1e 100644 --- a/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthNone.cs +++ b/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthNone.cs @@ -28,7 +28,6 @@ FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL OF THE POSSIBILITY OF SUCH DAMAGE. */ -using System; using System.Net.Sockets; namespace Titanium.Web.Proxy.ProxySocket.Authentication diff --git a/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthUserPass.cs b/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthUserPass.cs index 18983bf13..e53d124f4 100644 --- a/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthUserPass.cs +++ b/src/Titanium.Web.Proxy/ProxySocket/Authentication/AuthUserPass.cs @@ -152,7 +152,7 @@ private void OnReceive(IAsyncResult ar) int recv = Server.EndReceive(ar); if (recv <= 0) throw new SocketException(10054); - + Received += recv; if (Received == 2) if (Buffer[1] == 0) diff --git a/src/Titanium.Web.Proxy/ProxySocket/HttpsHandler.cs b/src/Titanium.Web.Proxy/ProxySocket/HttpsHandler.cs index 610a84fa9..adbb61e0c 100644 --- a/src/Titanium.Web.Proxy/ProxySocket/HttpsHandler.cs +++ b/src/Titanium.Web.Proxy/ProxySocket/HttpsHandler.cs @@ -136,10 +136,10 @@ 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) { diff --git a/src/Titanium.Web.Proxy/ProxySocket/Socks5Handler.cs b/src/Titanium.Web.Proxy/ProxySocket/Socks5Handler.cs index 65d228967..ae84848db 100644 --- a/src/Titanium.Web.Proxy/ProxySocket/Socks5Handler.cs +++ b/src/Titanium.Web.Proxy/ProxySocket/Socks5Handler.cs @@ -90,7 +90,7 @@ private void Authenticate(byte[] buffer) ReadBytes(buffer, 2); if (buffer[1] == 255) throw new ProxyException("No authentication method accepted."); - + AuthMethod authenticate; switch (buffer[1]) { @@ -120,7 +120,7 @@ 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(); @@ -206,7 +206,7 @@ public override void Negotiate(IPEndPoint remoteEP) try { Authenticate(buffer); - + int length = GetEndPointBytes(remoteEP, buffer); Negotiate(buffer, length); } diff --git a/src/Titanium.Web.Proxy/ProxySocket/SocksHandler.cs b/src/Titanium.Web.Proxy/ProxySocket/SocksHandler.cs index 10ee77785..9fbc8925f 100644 --- a/src/Titanium.Web.Proxy/ProxySocket/SocksHandler.cs +++ b/src/Titanium.Web.Proxy/ProxySocket/SocksHandler.cs @@ -121,7 +121,7 @@ protected void HandleEndReceive(IAsyncResult ar) int recv = Server.EndReceive(ar); if (recv <= 0) throw new SocketException(10054); - + Received += recv; } diff --git a/src/Titanium.Web.Proxy/RequestHandler.cs b/src/Titanium.Web.Proxy/RequestHandler.cs index 61238f6b1..350b3c909 100644 --- a/src/Titanium.Web.Proxy/RequestHandler.cs +++ b/src/Titanium.Web.Proxy/RequestHandler.cs @@ -33,7 +33,7 @@ public partial class ProxyServer /// 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, + private async Task handleHttpSessionRequest(ProxyEndPoint endPoint, HttpClientStream clientStream, CancellationTokenSource cancellationTokenSource, TunnelConnectSessionEventArgs? connectArgs = null, Task? prefetchConnectionTask = null, bool isHttps = false) { @@ -50,7 +50,7 @@ private async Task handleHttpSessionRequest(ProxyEndPoint endPoint, HttpClientSt // Loop through each subsequent request on this particular client connection // (assuming HTTP connection is kept alive by client) while (true) - { + { if (clientStream.IsClosed) { return; @@ -152,7 +152,7 @@ await HeaderParser.ReadHeaders(clientStream, args.HttpClient.Request.Headers, } catch (SocketException e) { - if(e.SocketErrorCode != SocketError.HostNotFound) + if (e.SocketErrorCode != SocketError.HostNotFound) { throw; } @@ -336,7 +336,7 @@ await args.HttpClient.SendRequest(Enable100ContinueBehaviour, args.IsTransparent headerBuilder.WriteResponseLine(response.HttpVersion, response.StatusCode, response.StatusDescription); headerBuilder.WriteHeaders(response.Headers); await writer.WriteHeadersAsync(headerBuilder, cancellationToken); - + await args.ClearResponse(cancellationToken); } diff --git a/src/Titanium.Web.Proxy/StreamExtended/ClientHelloInfo.cs b/src/Titanium.Web.Proxy/StreamExtended/ClientHelloInfo.cs index 9dc0b56ba..8713afdd4 100644 --- a/src/Titanium.Web.Proxy/StreamExtended/ClientHelloInfo.cs +++ b/src/Titanium.Web.Proxy/StreamExtended/ClientHelloInfo.cs @@ -135,8 +135,8 @@ public override string ToString() if (CompressionData != null && CompressionData.Length > 0) { int compressionMethod = CompressionData[0]; - string compression = compressions.Length > compressionMethod - ? compressions[compressionMethod] + string compression = compressions.Length > compressionMethod + ? compressions[compressionMethod] : $"unknown [0x{compressionMethod:X2}]"; sb.AppendLine($"Compression: {compression}"); } diff --git a/src/Titanium.Web.Proxy/StreamExtended/Models/SslCiphers.cs b/src/Titanium.Web.Proxy/StreamExtended/Models/SslCiphers.cs index 8f66b7b27..9e0a166ad 100644 --- a/src/Titanium.Web.Proxy/StreamExtended/Models/SslCiphers.cs +++ b/src/Titanium.Web.Proxy/StreamExtended/Models/SslCiphers.cs @@ -173,6 +173,12 @@ internal static class SslCiphers { 0x00C4, "TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256" }, { 0x00C5, "TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256" }, { 0x00FF, "TLS_EMPTY_RENEGOTIATION_INFO_SCSV" }, + // RFC 8446 + { 0x1301, "TLS_AES_128_GCM_SHA256" }, + { 0x1302, "TLS_AES_256_GCM_SHA384" }, + { 0x1303, "TLS_CHACHA20_POLY1305_SHA256" }, + { 0x1304, "TLS_AES_128_CCM_SHA256" }, + { 0x1305, "TLS_AES_128_CCM_8_SHA256" }, { 0x5600, "TLS_FALLBACK_SCSV" }, // RFC 4492 { 0xC001, "TLS_ECDH_ECDSA_WITH_NULL_SHA" }, @@ -353,6 +359,15 @@ internal static class SslCiphers { 0xC0AD, "TLS_ECDHE_ECDSA_WITH_AES_256_CCM" }, { 0xC0AE, "TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8" }, { 0xC0AF, "TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8" }, + { 0xC0B0, "TLS_ECCPWD_WITH_AES_128_GCM_SHA256" }, + { 0xC0B1, "TLS_ECCPWD_WITH_AES_256_GCM_SHA384" }, + { 0xC0B2, "TLS_ECCPWD_WITH_AES_128_CCM_SHA256" }, + { 0xC0B3, "TLS_ECCPWD_WITH_AES_256_CCM_SHA384" }, + { 0xC0B4, "TLS_SHA256_SHA256" }, + { 0xC0B5, "TLS_SHA384_SHA384" }, + { 0xC100, "TLS_GOSTR341112_256_WITH_KUZNYECHIK_CTR_OMAC" }, + { 0xC101, "TLS_GOSTR341112_256_WITH_MAGMA_CTR_OMAC" }, + { 0xC102, "TLS_GOSTR341112_256_WITH_28147_CNT_IMIT" }, // old numbers used in the beginning http://tools.ietf.org/html/draft-agl-tls-chacha20poly1305 { 0xCC13, "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256" }, { 0xCC14, "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256" }, @@ -365,6 +380,11 @@ internal static class SslCiphers { 0xCCAC, "TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256" }, { 0xCCAD, "TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256" }, { 0xCCAE, "TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256" }, + // RFC 8442 + { 0xD001, "TLS_ECDHE_PSK_WITH_AES_128_GCM_SHA256" }, + { 0xD002, "TLS_ECDHE_PSK_WITH_AES_256_GCM_SHA384" }, + { 0xD003, "TLS_ECDHE_PSK_WITH_AES_128_CCM_8_SHA256" }, + { 0xD005, "TLS_ECDHE_PSK_WITH_AES_128_CCM_SHA256" }, // http://tools.ietf.org/html/draft-josefsson-salsa20-tls { 0xE410, "TLS_RSA_WITH_ESTREAM_SALSA20_SHA1" }, { 0xE411, "TLS_RSA_WITH_SALSA20_SHA1" }, diff --git a/src/Titanium.Web.Proxy/StreamExtended/Network/IHttpStreamWriter.cs b/src/Titanium.Web.Proxy/StreamExtended/Network/IHttpStreamWriter.cs index 023cf02e9..6cfd89c40 100644 --- a/src/Titanium.Web.Proxy/StreamExtended/Network/IHttpStreamWriter.cs +++ b/src/Titanium.Web.Proxy/StreamExtended/Network/IHttpStreamWriter.cs @@ -1,5 +1,4 @@ -using System; -using System.Threading; +using System.Threading; using System.Threading.Tasks; namespace Titanium.Web.Proxy.StreamExtended.Network diff --git a/src/Titanium.Web.Proxy/StreamExtended/Network/PeekStreamReader.cs b/src/Titanium.Web.Proxy/StreamExtended/Network/PeekStreamReader.cs index 996f2f700..0740fee64 100644 --- a/src/Titanium.Web.Proxy/StreamExtended/Network/PeekStreamReader.cs +++ b/src/Titanium.Web.Proxy/StreamExtended/Network/PeekStreamReader.cs @@ -1,5 +1,4 @@ -using System; -using System.Threading; +using System.Threading; using System.Threading.Tasks; namespace Titanium.Web.Proxy.StreamExtended.Network @@ -52,5 +51,5 @@ public byte[] ReadBytes(int length) return buffer; } - } + } } diff --git a/src/Titanium.Web.Proxy/StreamExtended/ServerHelloInfo.cs b/src/Titanium.Web.Proxy/StreamExtended/ServerHelloInfo.cs index bbcccda3f..f2c690955 100644 --- a/src/Titanium.Web.Proxy/StreamExtended/ServerHelloInfo.cs +++ b/src/Titanium.Web.Proxy/StreamExtended/ServerHelloInfo.cs @@ -105,8 +105,8 @@ public override string ToString() } } - string compression = compressions.Length > CompressionMethod - ? compressions[CompressionMethod] + string compression = compressions.Length > CompressionMethod + ? compressions[CompressionMethod] : $"unknown [0x{CompressionMethod:X2}]"; sb.AppendLine($"Compression: {compression}"); diff --git a/src/Titanium.Web.Proxy/StreamExtended/SslTools.cs b/src/Titanium.Web.Proxy/StreamExtended/SslTools.cs index c6628a814..59c08d81a 100644 --- a/src/Titanium.Web.Proxy/StreamExtended/SslTools.cs +++ b/src/Titanium.Web.Proxy/StreamExtended/SslTools.cs @@ -151,7 +151,7 @@ internal class SslTools Dictionary? extensions = null; - if(extensionsStartPosition < recordLength + 5) + if (extensionsStartPosition < recordLength + 5) { extensions = await ReadExtensions(majorVersion, minorVersion, peekStream, cancellationToken); } @@ -291,7 +291,7 @@ public static async Task IsServerHello(IPeekStream stream, IBufferPool buf 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) diff --git a/src/Titanium.Web.Proxy/TransparentClientHandler.cs b/src/Titanium.Web.Proxy/TransparentClientHandler.cs index 56cdda24d..9f064b354 100644 --- a/src/Titanium.Web.Proxy/TransparentClientHandler.cs +++ b/src/Titanium.Web.Proxy/TransparentClientHandler.cs @@ -90,7 +90,7 @@ private async Task handleClient(TransparentBaseProxyEndPoint endPoint, TcpClient } 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, HttpHeader.VersionUnknown, false, null, true, sessionArgs, UpStreamEndPoint, diff --git a/src/Titanium.Web.Proxy/WebSocketDecoder.cs b/src/Titanium.Web.Proxy/WebSocket/WebSocketDecoder.cs similarity index 93% rename from src/Titanium.Web.Proxy/WebSocketDecoder.cs rename to src/Titanium.Web.Proxy/WebSocket/WebSocketDecoder.cs index c21c01187..61fd619d5 100644 --- a/src/Titanium.Web.Proxy/WebSocketDecoder.cs +++ b/src/Titanium.Web.Proxy/WebSocket/WebSocketDecoder.cs @@ -42,7 +42,7 @@ public IEnumerable Decode(byte[] data, int offset, int count) long size = b & 0x7f; // todo: size > int.Max?? - + bool masked = (b & 0x80) != 0; int idx = 2; @@ -100,7 +100,7 @@ public IEnumerable Decode(byte[] data, int offset, int count) { data1[pos + 2] ^= (byte)(mask >> 16); } -; } + } } var frameData = buffer.Slice(idx, (int)size); @@ -114,6 +114,19 @@ public IEnumerable Decode(byte[] data, int offset, int count) { copyToBuffer(buffer); } + + if (copied) + { + if (buffer.Length == 0) + { + bufferLength = 0; + } + else + { + buffer.CopyTo(this.buffer); + bufferLength = buffer.Length; + } + } } private Memory copyToBuffer(ReadOnlyMemory data) diff --git a/src/Titanium.Web.Proxy/WebSocketFrame.cs b/src/Titanium.Web.Proxy/WebSocket/WebSocketFrame.cs similarity index 98% rename from src/Titanium.Web.Proxy/WebSocketFrame.cs rename to src/Titanium.Web.Proxy/WebSocket/WebSocketFrame.cs index b30067a99..bea027d3d 100644 --- a/src/Titanium.Web.Proxy/WebSocketFrame.cs +++ b/src/Titanium.Web.Proxy/WebSocket/WebSocketFrame.cs @@ -6,7 +6,7 @@ namespace Titanium.Web.Proxy public class WebSocketFrame { public bool IsFinal { get; internal set; } - + public WebsocketOpCode OpCode { get; internal set; } public ReadOnlyMemory Data { get; internal set; } diff --git a/src/Titanium.Web.Proxy/WebsocketOpCode.cs b/src/Titanium.Web.Proxy/WebSocket/WebsocketOpCode.cs similarity index 100% rename from src/Titanium.Web.Proxy/WebsocketOpCode.cs rename to src/Titanium.Web.Proxy/WebSocket/WebsocketOpCode.cs diff --git a/src/Titanium.Web.Proxy/WebSocketHandler.cs b/src/Titanium.Web.Proxy/WebSocketHandler.cs index 97ad90384..371771a9d 100644 --- a/src/Titanium.Web.Proxy/WebSocketHandler.cs +++ b/src/Titanium.Web.Proxy/WebSocketHandler.cs @@ -1,5 +1,4 @@ -using System; -using System.Threading; +using System.Threading; using System.Threading.Tasks; using Titanium.Web.Proxy.EventArguments; using Titanium.Web.Proxy.Helpers; @@ -21,7 +20,7 @@ private async Task handleWebSocketUpgrade(SessionEventArgs args, await serverConnection.Stream.WriteRequestAsync(args.HttpClient.Request, cancellationToken); var httpStatus = await serverConnection.Stream.ReadResponseStatus(cancellationToken); - + var response = args.HttpClient.Response; response.HttpVersion = httpStatus.Version; response.StatusCode = httpStatus.StatusCode; diff --git a/tests/Titanium.Web.Proxy.IntegrationTests/Helpers/HttpMessageParsing.cs b/tests/Titanium.Web.Proxy.IntegrationTests/Helpers/HttpMessageParsing.cs index fe518385e..c4fdc0086 100644 --- a/tests/Titanium.Web.Proxy.IntegrationTests/Helpers/HttpMessageParsing.cs +++ b/tests/Titanium.Web.Proxy.IntegrationTests/Helpers/HttpMessageParsing.cs @@ -27,7 +27,9 @@ internal static Request ParseRequest(string messageText, bool requireBody) Request.ParseRequestLine(line, out var method, out var url, out var version); var request = new Request { - Method = method, RequestUriString8 = url, HttpVersion = version + Method = method, + RequestUriString8 = url, + HttpVersion = version }; while (!string.IsNullOrEmpty(line = reader.ReadLine())) { @@ -72,7 +74,9 @@ internal static Response ParseResponse(string messageText) Response.ParseResponseLine(line, out var version, out var status, out var desc); var response = new Response { - HttpVersion = version, StatusCode = status, StatusDescription = desc + HttpVersion = version, + StatusCode = status, + StatusDescription = desc }; while (!string.IsNullOrEmpty(line = reader.ReadLine())) @@ -107,7 +111,7 @@ private static bool parseBody(StringReader reader, RequestResponseBase obj) } obj.Body = Encoding.ASCII.GetBytes(reader.ReadToEnd()); - + // done reading body return obj.ContentLength == obj.OriginalContentLength; } diff --git a/tests/Titanium.Web.Proxy.IntegrationTests/Helpers/TestHelper.cs b/tests/Titanium.Web.Proxy.IntegrationTests/Helpers/TestHelper.cs index f21abe57e..f5c456018 100644 --- a/tests/Titanium.Web.Proxy.IntegrationTests/Helpers/TestHelper.cs +++ b/tests/Titanium.Web.Proxy.IntegrationTests/Helpers/TestHelper.cs @@ -14,7 +14,7 @@ public static HttpClient GetHttpClient(int localProxyPort, var handler = new HttpClientHandler { Proxy = proxy, - UseProxy = true + UseProxy = true }; return new HttpClient(handler); diff --git a/tests/Titanium.Web.Proxy.IntegrationTests/InterceptionTests.cs b/tests/Titanium.Web.Proxy.IntegrationTests/InterceptionTests.cs index ef7543cdb..d07bcf60f 100644 --- a/tests/Titanium.Web.Proxy.IntegrationTests/InterceptionTests.cs +++ b/tests/Titanium.Web.Proxy.IntegrationTests/InterceptionTests.cs @@ -72,7 +72,7 @@ public async Task Can_Intercept_Post_Requests() 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.")); Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); diff --git a/tests/Titanium.Web.Proxy.IntegrationTests/Setup/TestServer.cs b/tests/Titanium.Web.Proxy.IntegrationTests/Setup/TestServer.cs index b6dcc2d31..0812f5882 100644 --- a/tests/Titanium.Web.Proxy.IntegrationTests/Setup/TestServer.cs +++ b/tests/Titanium.Web.Proxy.IntegrationTests/Setup/TestServer.cs @@ -1,15 +1,15 @@ -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.Connections; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting.Server.Features; using Microsoft.AspNetCore.Http; 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 { diff --git a/tests/Titanium.Web.Proxy.IntegrationTests/Setup/TestSuite.cs b/tests/Titanium.Web.Proxy.IntegrationTests/Setup/TestSuite.cs index 0ad344270..26fa258ba 100644 --- a/tests/Titanium.Web.Proxy.IntegrationTests/Setup/TestSuite.cs +++ b/tests/Titanium.Web.Proxy.IntegrationTests/Setup/TestSuite.cs @@ -1,5 +1,4 @@ -using System; -using System.Net.Http; +using System.Net.Http; using Titanium.Web.Proxy.IntegrationTests.Helpers; using Titanium.Web.Proxy.IntegrationTests.Setup; diff --git a/tests/Titanium.Web.Proxy.IntegrationTests/Titanium.Web.Proxy.IntegrationTests.csproj b/tests/Titanium.Web.Proxy.IntegrationTests/Titanium.Web.Proxy.IntegrationTests.csproj index ec24902b5..af535f024 100644 --- a/tests/Titanium.Web.Proxy.IntegrationTests/Titanium.Web.Proxy.IntegrationTests.csproj +++ b/tests/Titanium.Web.Proxy.IntegrationTests/Titanium.Web.Proxy.IntegrationTests.csproj @@ -18,6 +18,7 @@ + diff --git a/tests/Titanium.Web.Proxy.UnitTests/CertificateManagerTests.cs b/tests/Titanium.Web.Proxy.UnitTests/CertificateManagerTests.cs index a97b5a3de..e0034f969 100644 --- a/tests/Titanium.Web.Proxy.UnitTests/CertificateManagerTests.cs +++ b/tests/Titanium.Web.Proxy.UnitTests/CertificateManagerTests.cs @@ -1,9 +1,9 @@ -using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Threading.Tasks; -using Microsoft.VisualStudio.TestTools.UnitTesting; using Titanium.Web.Proxy.Network; namespace Titanium.Web.Proxy.UnitTests diff --git a/tests/Titanium.Web.Proxy.UnitTests/ProxyServerTests.cs b/tests/Titanium.Web.Proxy.UnitTests/ProxyServerTests.cs index 8b5a729ae..46593d00b 100644 --- a/tests/Titanium.Web.Proxy.UnitTests/ProxyServerTests.cs +++ b/tests/Titanium.Web.Proxy.UnitTests/ProxyServerTests.cs @@ -1,6 +1,6 @@ -using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; using System.Net; -using Microsoft.VisualStudio.TestTools.UnitTesting; using Titanium.Web.Proxy.Models; namespace Titanium.Web.Proxy.UnitTests diff --git a/tests/Titanium.Web.Proxy.UnitTests/SystemProxyTest.cs b/tests/Titanium.Web.Proxy.UnitTests/SystemProxyTest.cs index 12bdd1ae1..8beeb236e 100644 --- a/tests/Titanium.Web.Proxy.UnitTests/SystemProxyTest.cs +++ b/tests/Titanium.Web.Proxy.UnitTests/SystemProxyTest.cs @@ -1,6 +1,6 @@ -using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; using System.Net; -using Microsoft.VisualStudio.TestTools.UnitTesting; using Titanium.Web.Proxy.Helpers; using Titanium.Web.Proxy.Helpers.WinHttp; using Titanium.Web.Proxy.Models; diff --git a/tests/Titanium.Web.Proxy.UnitTests/WinAuthTests.cs b/tests/Titanium.Web.Proxy.UnitTests/WinAuthTests.cs index fd9c9f4aa..66e8ef3c8 100644 --- a/tests/Titanium.Web.Proxy.UnitTests/WinAuthTests.cs +++ b/tests/Titanium.Web.Proxy.UnitTests/WinAuthTests.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Microsoft.VisualStudio.TestTools.UnitTesting; using Titanium.Web.Proxy.Http; using Titanium.Web.Proxy.Network.WinAuth;
    CertificateManagerCertificateManager