Skip to content
This repository was archived by the owner on Jul 9, 2023. It is now read-only.

Commit 3a62c35

Browse files
authored
Merge pull request #723 from justcoding121/master
stable
2 parents 3461257 + 6db82ba commit 3a62c35

22 files changed

+472
-80
lines changed

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Kindly report only issues/bugs here. For programming help or questions use [Stac
1515
* View/modify/redirect/block requests and responses
1616
* Supports mutual SSL authentication, proxy authentication & automatic upstream proxy detection
1717
* Kerberos/NTLM authentication over HTTP protocols for windows domain
18+
* SOCKS4/5 Proxy support
1819

1920
### Installation
2021
Install by [nuget](https://www.nuget.org/packages/Titanium.Web.Proxy)
@@ -29,21 +30,21 @@ For stable releases on [stable branch](https://github.com/justcoding121/Titanium
2930

3031
Supports
3132

32-
* .Net Standard 2.0 or above
33-
* .Net Framework 4.6.1 or above
33+
* .NET Standard 2.0 or above
34+
* .NET Framework 4.5 or above
3435

3536
### Development environment
3637

3738
#### Windows
38-
* Visual Studio Code as IDE for .NET core
39-
* Visual Studio 2017/2019 as IDE for .NET framework/.NET core
39+
* Visual Studio Code as IDE for .NET Core
40+
* Visual Studio 2019 as IDE for .NET Framework/.NET Core
4041

4142
#### Mac OS
42-
* Visual Studio Code as IDE for .NET core
43-
* Visual Studio 2017 as IDE for Mono
43+
* Visual Studio Code as IDE for .NET Core
44+
* Visual Studio 2019 as IDE for Mono
4445

4546
#### Linux
46-
* Visual Studio Code as IDE for .NET core
47+
* Visual Studio Code as IDE for .NET Core
4748
* Mono develop as IDE for Mono
4849

4950
### Usage
@@ -191,7 +192,7 @@ public async Task OnResponse(object sender, SessionEventArgs e)
191192
{
192193
if (e.HttpClient.Response.ResponseStatusCode == "200")
193194
{
194-
if (e.HttpClient.Response.ContentType!=null && e.HttpClient.Response.ContentType.Trim().ToLower().Contains("text/html"))
195+
if (e.HttpClient.Response.ContentType != null && e.HttpClient.Response.ContentType.Trim().ToLower().Contains("text/html"))
195196
{
196197
byte[] bodyBytes = await e.GetResponseBody();
197198
await e.SetResponseBody(bodyBytes);
@@ -202,7 +203,7 @@ public async Task OnResponse(object sender, SessionEventArgs e)
202203
}
203204
}
204205

205-
if (e.UserData!=null)
206+
if (e.UserData != null)
206207
{
207208
// access request from UserData property where we stored it in RequestHandler
208209
var request = (Request)e.UserData;
@@ -216,14 +217,14 @@ public Task OnCertificateValidation(object sender, CertificateValidationEventArg
216217
if (e.SslPolicyErrors == System.Net.Security.SslPolicyErrors.None)
217218
e.IsValid = true;
218219

219-
return Task.FromResult(0);
220+
return Task.CompletedTask;
220221
}
221222

222223
// Allows overriding default client certificate selection logic during mutual authentication
223224
public Task OnCertificateSelection(object sender, CertificateSelectionEventArgs e)
224225
{
225226
// set e.clientCertificate to override
226-
return Task.FromResult(0);
227+
return Task.CompletedTask;
227228
}
228229
```
229230
### Note to contributors

docs/api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ <h5>Inherited Members</h5>
155155
<div>
156156
<a class="xref" href="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_IsTransparent">SessionEventArgsBase.IsTransparent</a>
157157
</div>
158+
<div>
159+
<a class="xref" href="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_IsSocks">SessionEventArgsBase.IsSocks</a>
160+
</div>
158161
<div>
159162
<a class="xref" href="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_Exception">SessionEventArgsBase.Exception</a>
160163
</div>

docs/api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ <h5 class="propertyValue">Property Value</h5>
390390
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_Exception.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.Exception%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
391391
</span>
392392
<span class="small pull-right mobile-hide">
393-
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/EventArguments/SessionEventArgsBase.cs/#L146">View Source</a>
393+
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/EventArguments/SessionEventArgsBase.cs/#L151">View Source</a>
394394
</span>
395395
<a id="Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_Exception_" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.Exception*"></a>
396396
<h4 id="Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_Exception" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.Exception">Exception</h4>
@@ -478,6 +478,37 @@ <h5 class="propertyValue">Property Value</h5>
478478
</tr>
479479
</tbody>
480480
</table>
481+
<span class="small pull-right mobile-hide">
482+
<span class="divider">|</span>
483+
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_IsSocks.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.IsSocks%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
484+
</span>
485+
<span class="small pull-right mobile-hide">
486+
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/EventArguments/SessionEventArgsBase.cs/#L146">View Source</a>
487+
</span>
488+
<a id="Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_IsSocks_" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.IsSocks*"></a>
489+
<h4 id="Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_IsSocks" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.IsSocks">IsSocks</h4>
490+
<div class="markdown level1 summary"><p>Is this a SOCKS endpoint?</p>
491+
</div>
492+
<div class="markdown level1 conceptual"></div>
493+
<h5 class="decalaration">Declaration</h5>
494+
<div class="codewrapper">
495+
<pre><code class="lang-csharp hljs">public bool IsSocks { get; }</code></pre>
496+
</div>
497+
<h5 class="propertyValue">Property Value</h5>
498+
<table class="table table-bordered table-striped table-condensed">
499+
<thead>
500+
<tr>
501+
<th>Type</th>
502+
<th>Description</th>
503+
</tr>
504+
</thead>
505+
<tbody>
506+
<tr>
507+
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
508+
<td></td>
509+
</tr>
510+
</tbody>
511+
</table>
481512
<span class="small pull-right mobile-hide">
482513
<span class="divider">|</span>
483514
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_IsTransparent.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.IsTransparent%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
@@ -702,7 +733,7 @@ <h3 id="methods">Methods
702733
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_Dispose.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.Dispose%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
703734
</span>
704735
<span class="small pull-right mobile-hide">
705-
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/EventArguments/SessionEventArgsBase.cs/#L151">View Source</a>
736+
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/EventArguments/SessionEventArgsBase.cs/#L156">View Source</a>
706737
</span>
707738
<a id="Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_Dispose_" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.Dispose*"></a>
708739
<h4 id="Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_Dispose" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.Dispose">Dispose()</h4>
@@ -718,7 +749,7 @@ <h5 class="decalaration">Declaration</h5>
718749
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_TerminateSession.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.TerminateSession%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
719750
</span>
720751
<span class="small pull-right mobile-hide">
721-
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/EventArguments/SessionEventArgsBase.cs/#L199">View Source</a>
752+
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/EventArguments/SessionEventArgsBase.cs/#L204">View Source</a>
722753
</span>
723754
<a id="Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_TerminateSession_" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.TerminateSession*"></a>
724755
<h4 id="Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_TerminateSession" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.TerminateSession">TerminateSession()</h4>
@@ -736,7 +767,7 @@ <h3 id="events">Events
736767
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_DataReceived.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.DataReceived%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
737768
</span>
738769
<span class="small pull-right mobile-hide">
739-
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/EventArguments/SessionEventArgsBase.cs/#L170">View Source</a>
770+
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/EventArguments/SessionEventArgsBase.cs/#L175">View Source</a>
740771
</span>
741772
<h4 id="Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_DataReceived" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.DataReceived">DataReceived</h4>
742773
<div class="markdown level1 summary"><p>Fired when data is received within this session from client/server.</p>
@@ -766,7 +797,7 @@ <h5 class="eventType">Event Type</h5>
766797
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_DataSent.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.DataSent%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
767798
</span>
768799
<span class="small pull-right mobile-hide">
769-
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/EventArguments/SessionEventArgsBase.cs/#L165">View Source</a>
800+
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/EventArguments/SessionEventArgsBase.cs/#L170">View Source</a>
770801
</span>
771802
<h4 id="Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_DataSent" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.DataSent">DataSent</h4>
772803
<div class="markdown level1 summary"><p>Fired when data is sent within this session to server/client.</p>

docs/api/Titanium.Web.Proxy.EventArguments.TunnelConnectSessionEventArgs.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ <h5>Inherited Members</h5>
152152
<div>
153153
<a class="xref" href="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_IsTransparent">SessionEventArgsBase.IsTransparent</a>
154154
</div>
155+
<div>
156+
<a class="xref" href="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_IsSocks">SessionEventArgsBase.IsSocks</a>
157+
</div>
155158
<div>
156159
<a class="xref" href="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_Exception">SessionEventArgsBase.Exception</a>
157160
</div>

docs/api/Titanium.Web.Proxy.Network.CertificateEngine.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ <h3 id="fields">Fields
108108
Default.</p>
109109
</td>
110110
</tr>
111+
<tr>
112+
<td id="Titanium_Web_Proxy_Network_CertificateEngine_BouncyCastleFast">BouncyCastleFast</td>
113+
<td></td>
114+
</tr>
111115
<tr>
112116
<td id="Titanium_Web_Proxy_Network_CertificateEngine_DefaultWindows">DefaultWindows</td>
113117
<td><p>Uses Windows Certification Generation API and only valid in Windows OS.

0 commit comments

Comments
 (0)