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

Commit 699956e

Browse files
committed
update readme
1 parent 3da0c59 commit 699956e

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

README.md

+21-15
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,29 @@ Setup HTTP proxy:
3434

3535
```csharp
3636
// listen to client request & server response events
37-
ProxyServer.BeforeRequest += OnRequest;
38-
ProxyServer.BeforeResponse += OnResponse;
39-
40-
//Exclude Https addresses you don't want to proxy
41-
//Usefull for clients that use certificate pinning
42-
//for example dropbox.com
43-
var explicitEndPoint = new ExplicitProxyEndPoint(IPAddress.Loopback, 8000, true){
44-
ExcludedHostNameRegex = new List<string>() { "dropbox.com" }
45-
};
46-
47-
var transparentEndPoint = new TransparentProxyEndPoint(IPAddress.Loopback, 8001, true);
37+
ProxyServer.BeforeRequest += OnRequest;
38+
ProxyServer.BeforeResponse += OnResponse;
39+
40+
//Exclude Https addresses you don't want to proxy
41+
//Usefull for clients that use certificate pinning
42+
//for example dropbox.com
43+
var explicitEndPoint = new ExplicitProxyEndPoint(IPAddress.Loopback, 8000, true){
44+
ExcludedHttpsHostNameRegex = new List<string>() { "dropbox.com" }
45+
};
46+
47+
var transparentEndPoint = new TransparentProxyEndPoint(IPAddress.Loopback, 8001, true);
48+
49+
ProxyServer.AddEndPoint(explicitEndPoint);
50+
ProxyServer.Start();
51+
52+
//You can also add/remove end points after proxy has been started
53+
ProxyServer.AddEndPoint(transparentEndPoint);
4854

49-
ProxyServer.AddEndPoint(explicitEndPoint);
50-
ProxyServer.AddEndPoint(transparentEndPoint);
51-
ProxyServer.Start();
55+
foreach (var endPoint in ProxyServer.ProxyEndPoints)
56+
Console.WriteLine("Listening on '{0}' endpoint at Ip {1} and port: {2} ", endPoint.GetType().Name, endPoint.IpAddress, endPoint.Port);
5257

53-
ProxyServer.SetAsSystemProxy(explicitEndPoint);
58+
ProxyServer.SetAsSystemHttpProxy(explicitEndPoint);
59+
ProxyServer.SetAsSystemHttpsProxy(explicitEndPoint);
5460

5561
//wait here (You can use something else as a wait function, I am using this as a demo)
5662
Console.Read();

0 commit comments

Comments
 (0)