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

Commit 83b0c73

Browse files
committed
update readme
1 parent e312b9b commit 83b0c73

File tree

2 files changed

+28
-8
lines changed

2 files changed

+28
-8
lines changed

README.md

+14-4
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,31 @@ Setup HTTP proxy:
4040
//Exclude Https addresses you don't want to proxy
4141
//Usefull for clients that use certificate pinning
4242
//for example dropbox.com
43-
var explicitEndPoint = new ExplicitProxyEndPoint(IPAddress.Loopback, 8000, true){
43+
var explicitEndPoint = new ExplicitProxyEndPoint(IPAddress.Any, 8000, true){
4444
ExcludedHttpsHostNameRegex = new List<string>() { "dropbox.com" }
4545
};
4646

47-
var transparentEndPoint = new TransparentProxyEndPoint(IPAddress.Loopback, 8001, true);
48-
47+
//An explicit endpoint is where the client knows about the exististance of a proxy
48+
//So client sends request in a proxy friendly manner
4949
ProxyServer.AddEndPoint(explicitEndPoint);
5050
ProxyServer.Start();
51-
51+
5252
//You can also add/remove end points after proxy has been started
53+
//Transparent endpoint is usefull for reverse proxying
54+
//A transparent endpoint usually requires a network router port forwarding HTTP(S) packets to this endpoint
55+
//Please read about it before asking questions!
56+
//Currently do not support Server Name Indication (SNI is not currently supported by SslStream class)
57+
//That means that the transparent endpoint will always provide the same Generic Certificate to all HTTPS requests
58+
//In this example only google.com will work for HTTPS requests
59+
//Other sites will receive a certificate mismatch warning on browser
60+
var transparentEndPoint = new TransparentProxyEndPoint(IPAddress.Any, 8001, true) { GenericCertificateName = "google.com"};
5361
ProxyServer.AddEndPoint(transparentEndPoint);
62+
ProxyServer.RemoveEndPoint(transparentEndPoint);
5463

5564
foreach (var endPoint in ProxyServer.ProxyEndPoints)
5665
Console.WriteLine("Listening on '{0}' endpoint at Ip {1} and port: {2} ", endPoint.GetType().Name, endPoint.IpAddress, endPoint.Port);
5766

67+
//Only explicit proxies can be set as system proxy!
5868
ProxyServer.SetAsSystemHttpProxy(explicitEndPoint);
5969
ProxyServer.SetAsSystemHttpsProxy(explicitEndPoint);
6070

Titanium.Web.Proxy.Test/ProxyTestController.cs

+14-4
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,31 @@ public void StartProxy()
1919
//Exclude Https addresses you don't want to proxy
2020
//Usefull for clients that use certificate pinning
2121
//for example dropbox.com
22-
var explicitEndPoint = new ExplicitProxyEndPoint(IPAddress.Loopback, 8000, true){
22+
var explicitEndPoint = new ExplicitProxyEndPoint(IPAddress.Any, 8000, true){
2323
ExcludedHttpsHostNameRegex = new List<string>() { "dropbox.com" }
2424
};
2525

26-
var transparentEndPoint = new TransparentProxyEndPoint(IPAddress.Loopback, 8001, true);
27-
26+
//An explicit endpoint is where the client knows about the exististance of a proxy
27+
//So client sends request in a proxy friendly manner
2828
ProxyServer.AddEndPoint(explicitEndPoint);
2929
ProxyServer.Start();
30-
30+
3131
//You can also add/remove end points after proxy has been started
32+
//Transparent endpoint is usefull for reverse proxying (client is not aware of the existance of proxy)
33+
//A transparent endpoint usually requires a network router port forwarding HTTP(S) packets to this endpoint
34+
//Currently do not support Server Name Indication (It is not currently supported by SslStream class)
35+
//That means that the transparent endpoint will always provide the same Generic Certificate to all HTTPS requests
36+
//In this example only google.com will work for HTTPS requests
37+
//Other sites will receive a certificate mismatch warning on browser
38+
//Please read about it before asking questions!
39+
var transparentEndPoint = new TransparentProxyEndPoint(IPAddress.Any, 8001, true) { GenericCertificateName = "google.com"};
3240
ProxyServer.AddEndPoint(transparentEndPoint);
41+
ProxyServer.RemoveEndPoint(transparentEndPoint);
3342

3443
foreach (var endPoint in ProxyServer.ProxyEndPoints)
3544
Console.WriteLine("Listening on '{0}' endpoint at Ip {1} and port: {2} ", endPoint.GetType().Name, endPoint.IpAddress, endPoint.Port);
3645

46+
//Only explicit proxies can be set as system proxy!
3747
ProxyServer.SetAsSystemHttpProxy(explicitEndPoint);
3848
ProxyServer.SetAsSystemHttpsProxy(explicitEndPoint);
3949
}

0 commit comments

Comments
 (0)