Unverified Commit 8fdadb17 authored by justcoding121's avatar justcoding121 Committed by GitHub

Merge pull request #437 from justcoding121/master

Cache key fixes 
parents ba234a9c d329afdd
......@@ -46,9 +46,16 @@ namespace Titanium.Web.Proxy.Network.Tcp
Version httpVersion, bool isHttps, List<SslApplicationProtocol> applicationProtocols, bool isConnect,
ProxyServer proxyServer, IPEndPoint upStreamEndPoint, ExternalProxy externalProxy)
{
//http version is ignored since its an application level decision b/w HTTP 1.0/1.1
//also when doing connect request MS Edge browser sends http 1.0 but uses 1.1 after server sends 1.1 its response.
//That can create cache miss for same server connection unneccessarily expecially when prefetcing with Connect.
//http version 2 is separated using applicationProtocols below.
var cacheKeyBuilder = new StringBuilder($"{remoteHostName}-{remotePort}" +
$"-{(httpVersion == null ? string.Empty : httpVersion.ToString())}" +
$"-{isHttps}-{isConnect}-");
//when creating Tcp client if isHttps is true then isConnect won't matter
//using {isHttps||isConnect} will prevent getting different cacheKeys
//in Explicit client handler for prefetch and in Request handler
//when checking for changed cache key!
$"-{isHttps}-{isHttps||isConnect}-");
if (applicationProtocols != null)
{
foreach (var protocol in applicationProtocols)
......
......@@ -265,14 +265,14 @@ or when server terminates connection from proxy.</p>
<a id="Titanium_Web_Proxy_EventArguments_SessionEventArgs_GenericResponse_" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgs.GenericResponse*"></a>
<h4 id="Titanium_Web_Proxy_EventArguments_SessionEventArgs_GenericResponse_System_Byte___System_Net_HttpStatusCode_System_Collections_Generic_Dictionary_System_String_Titanium_Web_Proxy_Models_HttpHeader__" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgs.GenericResponse(System.Byte[],System.Net.HttpStatusCode,System.Collections.Generic.Dictionary{System.String,Titanium.Web.Proxy.Models.HttpHeader})">GenericResponse(Byte[], HttpStatusCode, Dictionary&lt;String, HttpHeader&gt;)</h4>
<h4 id="Titanium_Web_Proxy_EventArguments_SessionEventArgs_GenericResponse_System_Byte___System_Net_HttpStatusCode_System_Collections_Generic_Dictionary_System_String_Titanium_Web_Proxy_Models_HttpHeader__System_Boolean_" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgs.GenericResponse(System.Byte[],System.Net.HttpStatusCode,System.Collections.Generic.Dictionary{System.String,Titanium.Web.Proxy.Models.HttpHeader},System.Boolean)">GenericResponse(Byte[], HttpStatusCode, Dictionary&lt;String, HttpHeader&gt;, Boolean)</h4>
<div class="markdown level1 summary"><p>Before request is made to server respond with the specified byte[],
the specified status to client. And then ignore the request.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void GenericResponse(byte[] result, HttpStatusCode status, Dictionary&lt;string, HttpHeader&gt; headers)</code></pre>
<pre><code class="lang-csharp hljs">public void GenericResponse(byte[] result, HttpStatusCode status, Dictionary&lt;string, HttpHeader&gt; headers, bool closeServerConnection = false)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
......@@ -300,6 +300,12 @@ the specified status to client. And then ignore the request.</p>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.dictionary-2">Dictionary</a>&lt;<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a>, <a class="xref" href="Titanium.Web.Proxy.Models.HttpHeader.html">HttpHeader</a>&gt;</td>
<td><span class="parametername">headers</span></td>
<td><p>The HTTP headers.</p>
</td>
</tr>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
<td><span class="parametername">closeServerConnection</span></td>
<td><p>Close the server connection?</p>
</td>
</tr>
</tbody>
......@@ -307,7 +313,7 @@ the specified status to client. And then ignore the request.</p>
<a id="Titanium_Web_Proxy_EventArguments_SessionEventArgs_GenericResponse_" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgs.GenericResponse*"></a>
<h4 id="Titanium_Web_Proxy_EventArguments_SessionEventArgs_GenericResponse_System_String_System_Net_HttpStatusCode_System_Collections_Generic_Dictionary_System_String_Titanium_Web_Proxy_Models_HttpHeader__" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgs.GenericResponse(System.String,System.Net.HttpStatusCode,System.Collections.Generic.Dictionary{System.String,Titanium.Web.Proxy.Models.HttpHeader})">GenericResponse(String, HttpStatusCode, Dictionary&lt;String, HttpHeader&gt;)</h4>
<h4 id="Titanium_Web_Proxy_EventArguments_SessionEventArgs_GenericResponse_System_String_System_Net_HttpStatusCode_System_Collections_Generic_Dictionary_System_String_Titanium_Web_Proxy_Models_HttpHeader__System_Boolean_" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgs.GenericResponse(System.String,System.Net.HttpStatusCode,System.Collections.Generic.Dictionary{System.String,Titanium.Web.Proxy.Models.HttpHeader},System.Boolean)">GenericResponse(String, HttpStatusCode, Dictionary&lt;String, HttpHeader&gt;, Boolean)</h4>
<div class="markdown level1 summary"><p>Before request is made to server
respond with the specified HTML string and the specified status to client.
And then ignore the request. </p>
......@@ -315,7 +321,7 @@ And then ignore the request. </p>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void GenericResponse(string html, HttpStatusCode status, Dictionary&lt;string, HttpHeader&gt; headers = null)</code></pre>
<pre><code class="lang-csharp hljs">public void GenericResponse(string html, HttpStatusCode status, Dictionary&lt;string, HttpHeader&gt; headers = null, bool closeServerConnection = false)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
......@@ -343,6 +349,12 @@ And then ignore the request. </p>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.dictionary-2">Dictionary</a>&lt;<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a>, <a class="xref" href="Titanium.Web.Proxy.Models.HttpHeader.html">HttpHeader</a>&gt;</td>
<td><span class="parametername">headers</span></td>
<td><p>The HTTP headers.</p>
</td>
</tr>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
<td><span class="parametername">closeServerConnection</span></td>
<td><p>Close the server connection?</p>
</td>
</tr>
</tbody>
......@@ -530,14 +542,14 @@ And then ignore the request. </p>
<a id="Titanium_Web_Proxy_EventArguments_SessionEventArgs_Ok_" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgs.Ok*"></a>
<h4 id="Titanium_Web_Proxy_EventArguments_SessionEventArgs_Ok_System_Byte___System_Collections_Generic_Dictionary_System_String_Titanium_Web_Proxy_Models_HttpHeader__" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgs.Ok(System.Byte[],System.Collections.Generic.Dictionary{System.String,Titanium.Web.Proxy.Models.HttpHeader})">Ok(Byte[], Dictionary&lt;String, HttpHeader&gt;)</h4>
<h4 id="Titanium_Web_Proxy_EventArguments_SessionEventArgs_Ok_System_Byte___System_Collections_Generic_Dictionary_System_String_Titanium_Web_Proxy_Models_HttpHeader__System_Boolean_" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgs.Ok(System.Byte[],System.Collections.Generic.Dictionary{System.String,Titanium.Web.Proxy.Models.HttpHeader},System.Boolean)">Ok(Byte[], Dictionary&lt;String, HttpHeader&gt;, Boolean)</h4>
<div class="markdown level1 summary"><p>Before request is made to server respond with the specified byte[] to client
and ignore the request. </p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void Ok(byte[] result, Dictionary&lt;string, HttpHeader&gt; headers = null)</code></pre>
<pre><code class="lang-csharp hljs">public void Ok(byte[] result, Dictionary&lt;string, HttpHeader&gt; headers = null, bool closeServerConnection = false)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
......@@ -559,6 +571,12 @@ and ignore the request. </p>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.dictionary-2">Dictionary</a>&lt;<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a>, <a class="xref" href="Titanium.Web.Proxy.Models.HttpHeader.html">HttpHeader</a>&gt;</td>
<td><span class="parametername">headers</span></td>
<td><p>The HTTP headers.</p>
</td>
</tr>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
<td><span class="parametername">closeServerConnection</span></td>
<td><p>Close the server connection?</p>
</td>
</tr>
</tbody>
......@@ -566,14 +584,14 @@ and ignore the request. </p>
<a id="Titanium_Web_Proxy_EventArguments_SessionEventArgs_Ok_" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgs.Ok*"></a>
<h4 id="Titanium_Web_Proxy_EventArguments_SessionEventArgs_Ok_System_String_System_Collections_Generic_Dictionary_System_String_Titanium_Web_Proxy_Models_HttpHeader__" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgs.Ok(System.String,System.Collections.Generic.Dictionary{System.String,Titanium.Web.Proxy.Models.HttpHeader})">Ok(String, Dictionary&lt;String, HttpHeader&gt;)</h4>
<h4 id="Titanium_Web_Proxy_EventArguments_SessionEventArgs_Ok_System_String_System_Collections_Generic_Dictionary_System_String_Titanium_Web_Proxy_Models_HttpHeader__System_Boolean_" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgs.Ok(System.String,System.Collections.Generic.Dictionary{System.String,Titanium.Web.Proxy.Models.HttpHeader},System.Boolean)">Ok(String, Dictionary&lt;String, HttpHeader&gt;, Boolean)</h4>
<div class="markdown level1 summary"><p>Before request is made to server respond with the specified HTML string to client
and ignore the request. </p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void Ok(string html, Dictionary&lt;string, HttpHeader&gt; headers = null)</code></pre>
<pre><code class="lang-csharp hljs">public void Ok(string html, Dictionary&lt;string, HttpHeader&gt; headers = null, bool closeServerConnection = false)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
......@@ -595,6 +613,12 @@ and ignore the request. </p>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.dictionary-2">Dictionary</a>&lt;<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a>, <a class="xref" href="Titanium.Web.Proxy.Models.HttpHeader.html">HttpHeader</a>&gt;</td>
<td><span class="parametername">headers</span></td>
<td><p>HTTP response headers.</p>
</td>
</tr>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
<td><span class="parametername">closeServerConnection</span></td>
<td><p>Close the server connection?</p>
</td>
</tr>
</tbody>
......@@ -602,13 +626,13 @@ and ignore the request. </p>
<a id="Titanium_Web_Proxy_EventArguments_SessionEventArgs_Redirect_" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgs.Redirect*"></a>
<h4 id="Titanium_Web_Proxy_EventArguments_SessionEventArgs_Redirect_System_String_" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgs.Redirect(System.String)">Redirect(String)</h4>
<h4 id="Titanium_Web_Proxy_EventArguments_SessionEventArgs_Redirect_System_String_System_Boolean_" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgs.Redirect(System.String,System.Boolean)">Redirect(String, Boolean)</h4>
<div class="markdown level1 summary"><p>Redirect to provided URL.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void Redirect(string url)</code></pre>
<pre><code class="lang-csharp hljs">public void Redirect(string url, bool closeServerConnection = false)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
......@@ -624,6 +648,12 @@ and ignore the request. </p>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
<td><span class="parametername">url</span></td>
<td><p>The URL to redirect.</p>
</td>
</tr>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
<td><span class="parametername">closeServerConnection</span></td>
<td><p>Close the server connection?</p>
</td>
</tr>
</tbody>
......@@ -631,13 +661,13 @@ and ignore the request. </p>
<a id="Titanium_Web_Proxy_EventArguments_SessionEventArgs_Respond_" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgs.Respond*"></a>
<h4 id="Titanium_Web_Proxy_EventArguments_SessionEventArgs_Respond_Titanium_Web_Proxy_Http_Response_" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgs.Respond(Titanium.Web.Proxy.Http.Response)">Respond(Response)</h4>
<h4 id="Titanium_Web_Proxy_EventArguments_SessionEventArgs_Respond_Titanium_Web_Proxy_Http_Response_System_Boolean_" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgs.Respond(Titanium.Web.Proxy.Http.Response,System.Boolean)">Respond(Response, Boolean)</h4>
<div class="markdown level1 summary"><p>Respond with given response object to client.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void Respond(Response response)</code></pre>
<pre><code class="lang-csharp hljs">public void Respond(Response response, bool closeServerConnection = false)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
......@@ -653,6 +683,12 @@ and ignore the request. </p>
<td><a class="xref" href="Titanium.Web.Proxy.Http.Response.html">Response</a></td>
<td><span class="parametername">response</span></td>
<td><p>The response object.</p>
</td>
</tr>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
<td><span class="parametername">closeServerConnection</span></td>
<td><p>Close the server connection?</p>
</td>
</tr>
</tbody>
......
......@@ -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 EventArgs SessionEventArgsBase SessionEventArgs Implements IDisposable Inherited Members SessionEventArgsBase.bufferSize SessionEventArgsBase.bufferPool SessionEventArgsBase.exceptionFunc SessionEventArgsBase.UserData SessionEventArgsBase.IsHttps SessionEventArgsBase.ClientEndPoint SessionEventArgsBase.WebSession SessionEventArgsBase.CustomUpStreamProxyUsed SessionEventArgsBase.LocalEndPoint SessionEventArgsBase.IsTransparent SessionEventArgsBase.Exception SessionEventArgsBase.DataSent SessionEventArgsBase.DataReceived SessionEventArgsBase.TerminateSession() EventArgs.Empty Object.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.EventArguments Assembly : Titanium.Web.Proxy.dll Syntax public class SessionEventArgs : SessionEventArgsBase, IDisposable Constructors SessionEventArgs(ProxyServer, ProxyEndPoint, Request, CancellationTokenSource) Declaration protected SessionEventArgs(ProxyServer server, ProxyEndPoint endPoint, Request request, CancellationTokenSource cancellationTokenSource) Parameters Type Name Description ProxyServer server ProxyEndPoint endPoint Request request CancellationTokenSource cancellationTokenSource Properties ReRequest Should we send the request again ? Declaration public bool ReRequest { get; set; } Property Value Type Description Boolean Methods Dispose() Implement any cleanup here Declaration public override void Dispose() Overrides SessionEventArgsBase.Dispose() GenericResponse(Byte[], HttpStatusCode, Dictionary<String, HttpHeader>) 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<string, HttpHeader> headers) Parameters Type Name Description System.Byte [] result The bytes to sent. HttpStatusCode status The HTTP status code. Dictionary < String , HttpHeader > headers The HTTP headers. GenericResponse(String, HttpStatusCode, Dictionary<String, HttpHeader>) 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<string, HttpHeader> headers = null) Parameters Type Name Description String html The html content. HttpStatusCode status The HTTP status code. Dictionary < String , HttpHeader > headers The HTTP headers. GetRequestBody(CancellationToken) Gets the request body as bytes. Declaration public Task<byte[]> GetRequestBody(CancellationToken cancellationToken = default(CancellationToken)) Parameters Type Name Description CancellationToken cancellationToken Optional cancellation token for this async task. Returns Type Description Task < System.Byte []> The body as bytes. GetRequestBodyAsString(CancellationToken) Gets the request body as string. Declaration public Task<string> 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. GetResponseBody(CancellationToken) Gets the response body as bytes. Declaration public Task<byte[]> GetResponseBody(CancellationToken cancellationToken = default(CancellationToken)) Parameters Type Name Description CancellationToken cancellationToken Optional cancellation token for this async task. Returns Type Description Task < System.Byte []> The resulting bytes. GetResponseBodyAsString(CancellationToken) Gets the response body as string. Declaration public Task<string> 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. Ok(Byte[], Dictionary<String, HttpHeader>) Before request is made to server respond with the specified byte[] to client and ignore the request. Declaration public void Ok(byte[] result, Dictionary<string, HttpHeader> headers = null) Parameters Type Name Description System.Byte [] result The html content bytes. Dictionary < String , HttpHeader > headers The HTTP headers. Ok(String, Dictionary<String, HttpHeader>) 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<string, HttpHeader> headers = null) Parameters Type Name Description String html HTML content to sent. Dictionary < String , HttpHeader > headers HTTP response headers. Redirect(String) Redirect to provided URL. Declaration public void Redirect(string url) Parameters Type Name Description String url The URL to redirect. Respond(Response) Respond with given response object to client. Declaration public void Respond(Response response) Parameters Type Name Description Response response The response object. SetRequestBody(Byte[]) Sets the request body. Declaration public void SetRequestBody(byte[] body) Parameters Type Name Description System.Byte [] body The request body bytes. 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. SetResponseBody(Byte[]) Set the response body bytes. Declaration public void SetResponseBody(byte[] body) Parameters Type Name Description System.Byte [] body The body bytes to set. 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. TerminateServerConnection() Terminate the connection to server. Declaration public void TerminateServerConnection() Events MultipartRequestPartSent Occurs when multipart request part sent. Declaration public event EventHandler<MultipartRequestPartSentEventArgs> 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 EventArgs SessionEventArgsBase SessionEventArgs Implements IDisposable Inherited Members SessionEventArgsBase.bufferSize SessionEventArgsBase.bufferPool SessionEventArgsBase.exceptionFunc SessionEventArgsBase.UserData SessionEventArgsBase.IsHttps SessionEventArgsBase.ClientEndPoint SessionEventArgsBase.WebSession SessionEventArgsBase.CustomUpStreamProxyUsed SessionEventArgsBase.LocalEndPoint SessionEventArgsBase.IsTransparent SessionEventArgsBase.Exception SessionEventArgsBase.DataSent SessionEventArgsBase.DataReceived SessionEventArgsBase.TerminateSession() EventArgs.Empty Object.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.EventArguments Assembly : Titanium.Web.Proxy.dll Syntax public class SessionEventArgs : SessionEventArgsBase, IDisposable Constructors SessionEventArgs(ProxyServer, ProxyEndPoint, Request, CancellationTokenSource) Declaration protected SessionEventArgs(ProxyServer server, ProxyEndPoint endPoint, Request request, CancellationTokenSource cancellationTokenSource) Parameters Type Name Description ProxyServer server ProxyEndPoint endPoint Request request CancellationTokenSource cancellationTokenSource Properties ReRequest Should we send the request again ? Declaration public bool ReRequest { get; set; } Property Value Type Description Boolean Methods Dispose() Implement any cleanup here Declaration public override void Dispose() Overrides SessionEventArgsBase.Dispose() GenericResponse(Byte[], HttpStatusCode, Dictionary<String, HttpHeader>, 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<string, HttpHeader> headers, bool closeServerConnection = false) Parameters Type Name Description System.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? GenericResponse(String, HttpStatusCode, Dictionary<String, HttpHeader>, 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<string, HttpHeader> 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? GetRequestBody(CancellationToken) Gets the request body as bytes. Declaration public Task<byte[]> GetRequestBody(CancellationToken cancellationToken = default(CancellationToken)) Parameters Type Name Description CancellationToken cancellationToken Optional cancellation token for this async task. Returns Type Description Task < System.Byte []> The body as bytes. GetRequestBodyAsString(CancellationToken) Gets the request body as string. Declaration public Task<string> 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. GetResponseBody(CancellationToken) Gets the response body as bytes. Declaration public Task<byte[]> GetResponseBody(CancellationToken cancellationToken = default(CancellationToken)) Parameters Type Name Description CancellationToken cancellationToken Optional cancellation token for this async task. Returns Type Description Task < System.Byte []> The resulting bytes. GetResponseBodyAsString(CancellationToken) Gets the response body as string. Declaration public Task<string> 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. Ok(Byte[], Dictionary<String, HttpHeader>, 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<string, HttpHeader> headers = null, bool closeServerConnection = false) Parameters Type Name Description System.Byte [] result The html content bytes. Dictionary < String , HttpHeader > headers The HTTP headers. Boolean closeServerConnection Close the server connection? Ok(String, Dictionary<String, HttpHeader>, 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<string, HttpHeader> 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? 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? 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? SetRequestBody(Byte[]) Sets the request body. Declaration public void SetRequestBody(byte[] body) Parameters Type Name Description System.Byte [] body The request body bytes. 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. SetResponseBody(Byte[]) Set the response body bytes. Declaration public void SetResponseBody(byte[] body) Parameters Type Name Description System.Byte [] body The body bytes to set. 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. TerminateServerConnection() Terminate the connection to server. Declaration public void TerminateServerConnection() Events MultipartRequestPartSent Occurs when multipart request part sent. Declaration public event EventHandler<MultipartRequestPartSentEventArgs> 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",
......
......@@ -273,24 +273,24 @@ references:
isSpec: "True"
fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Dispose
nameWithType: SessionEventArgs.Dispose
- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.GenericResponse(System.Byte[],System.Net.HttpStatusCode,System.Collections.Generic.Dictionary{System.String,Titanium.Web.Proxy.Models.HttpHeader})
name: GenericResponse(Byte[], HttpStatusCode, Dictionary<String, HttpHeader>)
href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs_GenericResponse_System_Byte___System_Net_HttpStatusCode_System_Collections_Generic_Dictionary_System_String_Titanium_Web_Proxy_Models_HttpHeader__
commentId: M:Titanium.Web.Proxy.EventArguments.SessionEventArgs.GenericResponse(System.Byte[],System.Net.HttpStatusCode,System.Collections.Generic.Dictionary{System.String,Titanium.Web.Proxy.Models.HttpHeader})
name.vb: GenericResponse(Byte(), HttpStatusCode, Dictionary(Of String, HttpHeader))
fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.GenericResponse(System.Byte[], System.Net.HttpStatusCode, System.Collections.Generic.Dictionary<System.String, Titanium.Web.Proxy.Models.HttpHeader>)
fullName.vb: Titanium.Web.Proxy.EventArguments.SessionEventArgs.GenericResponse(System.Byte(), System.Net.HttpStatusCode, System.Collections.Generic.Dictionary(Of System.String, Titanium.Web.Proxy.Models.HttpHeader))
nameWithType: SessionEventArgs.GenericResponse(Byte[], HttpStatusCode, Dictionary<String, HttpHeader>)
nameWithType.vb: SessionEventArgs.GenericResponse(Byte(), HttpStatusCode, Dictionary(Of String, HttpHeader))
- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.GenericResponse(System.String,System.Net.HttpStatusCode,System.Collections.Generic.Dictionary{System.String,Titanium.Web.Proxy.Models.HttpHeader})
name: GenericResponse(String, HttpStatusCode, Dictionary<String, HttpHeader>)
href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs_GenericResponse_System_String_System_Net_HttpStatusCode_System_Collections_Generic_Dictionary_System_String_Titanium_Web_Proxy_Models_HttpHeader__
commentId: M:Titanium.Web.Proxy.EventArguments.SessionEventArgs.GenericResponse(System.String,System.Net.HttpStatusCode,System.Collections.Generic.Dictionary{System.String,Titanium.Web.Proxy.Models.HttpHeader})
name.vb: GenericResponse(String, HttpStatusCode, Dictionary(Of String, HttpHeader))
fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.GenericResponse(System.String, System.Net.HttpStatusCode, System.Collections.Generic.Dictionary<System.String, Titanium.Web.Proxy.Models.HttpHeader>)
fullName.vb: Titanium.Web.Proxy.EventArguments.SessionEventArgs.GenericResponse(System.String, System.Net.HttpStatusCode, System.Collections.Generic.Dictionary(Of System.String, Titanium.Web.Proxy.Models.HttpHeader))
nameWithType: SessionEventArgs.GenericResponse(String, HttpStatusCode, Dictionary<String, HttpHeader>)
nameWithType.vb: SessionEventArgs.GenericResponse(String, HttpStatusCode, Dictionary(Of String, HttpHeader))
- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.GenericResponse(System.Byte[],System.Net.HttpStatusCode,System.Collections.Generic.Dictionary{System.String,Titanium.Web.Proxy.Models.HttpHeader},System.Boolean)
name: GenericResponse(Byte[], HttpStatusCode, Dictionary<String, HttpHeader>, Boolean)
href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs_GenericResponse_System_Byte___System_Net_HttpStatusCode_System_Collections_Generic_Dictionary_System_String_Titanium_Web_Proxy_Models_HttpHeader__System_Boolean_
commentId: M:Titanium.Web.Proxy.EventArguments.SessionEventArgs.GenericResponse(System.Byte[],System.Net.HttpStatusCode,System.Collections.Generic.Dictionary{System.String,Titanium.Web.Proxy.Models.HttpHeader},System.Boolean)
name.vb: GenericResponse(Byte(), HttpStatusCode, Dictionary(Of String, HttpHeader), Boolean)
fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.GenericResponse(System.Byte[], System.Net.HttpStatusCode, System.Collections.Generic.Dictionary<System.String, Titanium.Web.Proxy.Models.HttpHeader>, System.Boolean)
fullName.vb: Titanium.Web.Proxy.EventArguments.SessionEventArgs.GenericResponse(System.Byte(), System.Net.HttpStatusCode, System.Collections.Generic.Dictionary(Of System.String, Titanium.Web.Proxy.Models.HttpHeader), System.Boolean)
nameWithType: SessionEventArgs.GenericResponse(Byte[], HttpStatusCode, Dictionary<String, HttpHeader>, Boolean)
nameWithType.vb: SessionEventArgs.GenericResponse(Byte(), HttpStatusCode, Dictionary(Of String, HttpHeader), Boolean)
- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.GenericResponse(System.String,System.Net.HttpStatusCode,System.Collections.Generic.Dictionary{System.String,Titanium.Web.Proxy.Models.HttpHeader},System.Boolean)
name: GenericResponse(String, HttpStatusCode, Dictionary<String, HttpHeader>, Boolean)
href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs_GenericResponse_System_String_System_Net_HttpStatusCode_System_Collections_Generic_Dictionary_System_String_Titanium_Web_Proxy_Models_HttpHeader__System_Boolean_
commentId: M:Titanium.Web.Proxy.EventArguments.SessionEventArgs.GenericResponse(System.String,System.Net.HttpStatusCode,System.Collections.Generic.Dictionary{System.String,Titanium.Web.Proxy.Models.HttpHeader},System.Boolean)
name.vb: GenericResponse(String, HttpStatusCode, Dictionary(Of String, HttpHeader), Boolean)
fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.GenericResponse(System.String, System.Net.HttpStatusCode, System.Collections.Generic.Dictionary<System.String, Titanium.Web.Proxy.Models.HttpHeader>, System.Boolean)
fullName.vb: Titanium.Web.Proxy.EventArguments.SessionEventArgs.GenericResponse(System.String, System.Net.HttpStatusCode, System.Collections.Generic.Dictionary(Of System.String, Titanium.Web.Proxy.Models.HttpHeader), System.Boolean)
nameWithType: SessionEventArgs.GenericResponse(String, HttpStatusCode, Dictionary<String, HttpHeader>, Boolean)
nameWithType.vb: SessionEventArgs.GenericResponse(String, HttpStatusCode, Dictionary(Of String, HttpHeader), Boolean)
- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.GenericResponse*
name: GenericResponse
href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs_GenericResponse_
......@@ -356,24 +356,24 @@ references:
commentId: E:Titanium.Web.Proxy.EventArguments.SessionEventArgs.MultipartRequestPartSent
fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.MultipartRequestPartSent
nameWithType: SessionEventArgs.MultipartRequestPartSent
- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Ok(System.Byte[],System.Collections.Generic.Dictionary{System.String,Titanium.Web.Proxy.Models.HttpHeader})
name: Ok(Byte[], Dictionary<String, HttpHeader>)
href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs_Ok_System_Byte___System_Collections_Generic_Dictionary_System_String_Titanium_Web_Proxy_Models_HttpHeader__
commentId: M:Titanium.Web.Proxy.EventArguments.SessionEventArgs.Ok(System.Byte[],System.Collections.Generic.Dictionary{System.String,Titanium.Web.Proxy.Models.HttpHeader})
name.vb: Ok(Byte(), Dictionary(Of String, HttpHeader))
fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Ok(System.Byte[], System.Collections.Generic.Dictionary<System.String, Titanium.Web.Proxy.Models.HttpHeader>)
fullName.vb: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Ok(System.Byte(), System.Collections.Generic.Dictionary(Of System.String, Titanium.Web.Proxy.Models.HttpHeader))
nameWithType: SessionEventArgs.Ok(Byte[], Dictionary<String, HttpHeader>)
nameWithType.vb: SessionEventArgs.Ok(Byte(), Dictionary(Of String, HttpHeader))
- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Ok(System.String,System.Collections.Generic.Dictionary{System.String,Titanium.Web.Proxy.Models.HttpHeader})
name: Ok(String, Dictionary<String, HttpHeader>)
href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs_Ok_System_String_System_Collections_Generic_Dictionary_System_String_Titanium_Web_Proxy_Models_HttpHeader__
commentId: M:Titanium.Web.Proxy.EventArguments.SessionEventArgs.Ok(System.String,System.Collections.Generic.Dictionary{System.String,Titanium.Web.Proxy.Models.HttpHeader})
name.vb: Ok(String, Dictionary(Of String, HttpHeader))
fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Ok(System.String, System.Collections.Generic.Dictionary<System.String, Titanium.Web.Proxy.Models.HttpHeader>)
fullName.vb: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Ok(System.String, System.Collections.Generic.Dictionary(Of System.String, Titanium.Web.Proxy.Models.HttpHeader))
nameWithType: SessionEventArgs.Ok(String, Dictionary<String, HttpHeader>)
nameWithType.vb: SessionEventArgs.Ok(String, Dictionary(Of String, HttpHeader))
- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Ok(System.Byte[],System.Collections.Generic.Dictionary{System.String,Titanium.Web.Proxy.Models.HttpHeader},System.Boolean)
name: Ok(Byte[], Dictionary<String, HttpHeader>, Boolean)
href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs_Ok_System_Byte___System_Collections_Generic_Dictionary_System_String_Titanium_Web_Proxy_Models_HttpHeader__System_Boolean_
commentId: M:Titanium.Web.Proxy.EventArguments.SessionEventArgs.Ok(System.Byte[],System.Collections.Generic.Dictionary{System.String,Titanium.Web.Proxy.Models.HttpHeader},System.Boolean)
name.vb: Ok(Byte(), Dictionary(Of String, HttpHeader), Boolean)
fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Ok(System.Byte[], System.Collections.Generic.Dictionary<System.String, Titanium.Web.Proxy.Models.HttpHeader>, System.Boolean)
fullName.vb: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Ok(System.Byte(), System.Collections.Generic.Dictionary(Of System.String, Titanium.Web.Proxy.Models.HttpHeader), System.Boolean)
nameWithType: SessionEventArgs.Ok(Byte[], Dictionary<String, HttpHeader>, Boolean)
nameWithType.vb: SessionEventArgs.Ok(Byte(), Dictionary(Of String, HttpHeader), Boolean)
- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Ok(System.String,System.Collections.Generic.Dictionary{System.String,Titanium.Web.Proxy.Models.HttpHeader},System.Boolean)
name: Ok(String, Dictionary<String, HttpHeader>, Boolean)
href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs_Ok_System_String_System_Collections_Generic_Dictionary_System_String_Titanium_Web_Proxy_Models_HttpHeader__System_Boolean_
commentId: M:Titanium.Web.Proxy.EventArguments.SessionEventArgs.Ok(System.String,System.Collections.Generic.Dictionary{System.String,Titanium.Web.Proxy.Models.HttpHeader},System.Boolean)
name.vb: Ok(String, Dictionary(Of String, HttpHeader), Boolean)
fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Ok(System.String, System.Collections.Generic.Dictionary<System.String, Titanium.Web.Proxy.Models.HttpHeader>, System.Boolean)
fullName.vb: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Ok(System.String, System.Collections.Generic.Dictionary(Of System.String, Titanium.Web.Proxy.Models.HttpHeader), System.Boolean)
nameWithType: SessionEventArgs.Ok(String, Dictionary<String, HttpHeader>, Boolean)
nameWithType.vb: SessionEventArgs.Ok(String, Dictionary(Of String, HttpHeader), Boolean)
- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Ok*
name: Ok
href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs_Ok_
......@@ -381,12 +381,12 @@ references:
isSpec: "True"
fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Ok
nameWithType: SessionEventArgs.Ok
- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Redirect(System.String)
name: Redirect(String)
href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs_Redirect_System_String_
commentId: M:Titanium.Web.Proxy.EventArguments.SessionEventArgs.Redirect(System.String)
fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Redirect(System.String)
nameWithType: SessionEventArgs.Redirect(String)
- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Redirect(System.String,System.Boolean)
name: Redirect(String, Boolean)
href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs_Redirect_System_String_System_Boolean_
commentId: M:Titanium.Web.Proxy.EventArguments.SessionEventArgs.Redirect(System.String,System.Boolean)
fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Redirect(System.String, System.Boolean)
nameWithType: SessionEventArgs.Redirect(String, Boolean)
- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Redirect*
name: Redirect
href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs_Redirect_
......@@ -407,12 +407,12 @@ references:
isSpec: "True"
fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.ReRequest
nameWithType: SessionEventArgs.ReRequest
- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Respond(Titanium.Web.Proxy.Http.Response)
name: Respond(Response)
href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs_Respond_Titanium_Web_Proxy_Http_Response_
commentId: M:Titanium.Web.Proxy.EventArguments.SessionEventArgs.Respond(Titanium.Web.Proxy.Http.Response)
fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Respond(Titanium.Web.Proxy.Http.Response)
nameWithType: SessionEventArgs.Respond(Response)
- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Respond(Titanium.Web.Proxy.Http.Response,System.Boolean)
name: Respond(Response, Boolean)
href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs_Respond_Titanium_Web_Proxy_Http_Response_System_Boolean_
commentId: M:Titanium.Web.Proxy.EventArguments.SessionEventArgs.Respond(Titanium.Web.Proxy.Http.Response,System.Boolean)
fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Respond(Titanium.Web.Proxy.Http.Response, System.Boolean)
nameWithType: SessionEventArgs.Respond(Response, Boolean)
- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgs.Respond*
name: Respond
href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html#Titanium_Web_Proxy_EventArguments_SessionEventArgs_Respond_
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment