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

Commit 4b830b5

Browse files
committed
Merge pull request #42 from justcoding121/master
Merge master to release
2 parents 1b650f0 + 637707c commit 4b830b5

File tree

1 file changed

+12
-31
lines changed

1 file changed

+12
-31
lines changed

README.md

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Refer the HTTP Proxy Server library in your project, look up Test project to lea
2222

2323
Install by nuget:
2424

25-
Install-Package Titanium.Web.Proxy -Pre
25+
Install-Package Titanium.Web.Proxy
2626

2727
After installing nuget package mark following files to be copied to app directory
2828

@@ -37,43 +37,25 @@ Setup HTTP proxy:
3737
ProxyServer.BeforeRequest += OnRequest;
3838
ProxyServer.BeforeResponse += OnResponse;
3939

40-
//Exclude Https addresses you don't want to proxy
41-
//Usefull for clients that use certificate pinning
42-
//for example dropbox.com
4340
var explicitEndPoint = new ExplicitProxyEndPoint(IPAddress.Any, 8000, true){
41+
//Exclude Https addresses you don't want to proxy/cannot be proxied
42+
//for example exclude dropbox client which use certificate pinning
4443
ExcludedHttpsHostNameRegex = new List<string>() { "dropbox.com" }
4544
};
4645

47-
//An explicit endpoint is where the client knows about the existance of a proxy
48-
//So client sends request in a proxy friendly manner
46+
//Add an explicit endpoint where the client is aware of the proxy
47+
//So client would send request in a proxy friendly manner
4948
ProxyServer.AddEndPoint(explicitEndPoint);
5049
ProxyServer.Start();
51-
52-
53-
//Transparent endpoint is usefull for reverse proxying (client is not aware of the existance of proxy)
54-
//A transparent endpoint usually requires a network router port forwarding HTTP(S) packets to this endpoint
55-
//Currently do not support Server Name Indication (It is not currently supported by SslStream class)
56-
//That means that the transparent endpoint will always provide the same Generic Certificate to all HTTPS requests
57-
//In this example only google.com will work for HTTPS requests
58-
//Other sites will receive a certificate mismatch warning on browser
59-
//Please read about it before asking questions!
60-
var transparentEndPoint = new TransparentProxyEndPoint(IPAddress.Any, 8001, true) {
61-
GenericCertificateName = "google.com"
62-
};
63-
ProxyServer.AddEndPoint(transparentEndPoint);
64-
65-
50+
51+
//Only explicit proxies can be set as a system proxy!
52+
ProxyServer.SetAsSystemHttpProxy(explicitEndPoint);
53+
ProxyServer.SetAsSystemHttpsProxy(explicitEndPoint);
54+
6655
foreach (var endPoint in ProxyServer.ProxyEndPoints)
6756
Console.WriteLine("Listening on '{0}' endpoint at Ip {1} and port: {2} ",
6857
endPoint.GetType().Name, endPoint.IpAddress, endPoint.Port);
6958

70-
//You can also add/remove end points after proxy has been started
71-
ProxyServer.RemoveEndPoint(transparentEndPoint);
72-
73-
//Only explicit proxies can be set as system proxy!
74-
ProxyServer.SetAsSystemHttpProxy(explicitEndPoint);
75-
ProxyServer.SetAsSystemHttpsProxy(explicitEndPoint);
76-
7759
//wait here (You can use something else as a wait function, I am using this as a demo)
7860
Console.Read();
7961

@@ -82,7 +64,6 @@ Setup HTTP proxy:
8264
ProxyServer.BeforeResponse -= OnResponse;
8365
ProxyServer.Stop();
8466

85-
8667
```
8768
Sample request and response event handlers
8869

@@ -144,10 +125,10 @@ Sample request and response event handlers
144125
}
145126
}
146127
```
147-
Future updates
128+
Future roadmap
148129
============
149130
* Add callbacks for client/server certificate validation/selection
150131
* Support mutual authentication
151-
* Add Server Name Indication (SNI) for transparent endpoints
132+
* Support Server Name Indication (SNI) for transparent endpoints
152133
* Support HTTP 2.0
153134

0 commit comments

Comments
 (0)