Commit 699956e3 authored by titanium007's avatar titanium007

update readme

parent 3da0c593
...@@ -34,23 +34,29 @@ Setup HTTP proxy: ...@@ -34,23 +34,29 @@ Setup HTTP proxy:
```csharp ```csharp
// listen to client request & server response events // listen to client request & server response events
ProxyServer.BeforeRequest += OnRequest; ProxyServer.BeforeRequest += OnRequest;
ProxyServer.BeforeResponse += OnResponse; ProxyServer.BeforeResponse += OnResponse;
//Exclude Https addresses you don't want to proxy //Exclude Https addresses you don't want to proxy
//Usefull for clients that use certificate pinning //Usefull for clients that use certificate pinning
//for example dropbox.com //for example dropbox.com
var explicitEndPoint = new ExplicitProxyEndPoint(IPAddress.Loopback, 8000, true){ var explicitEndPoint = new ExplicitProxyEndPoint(IPAddress.Loopback, 8000, true){
ExcludedHostNameRegex = new List<string>() { "dropbox.com" } ExcludedHttpsHostNameRegex = new List<string>() { "dropbox.com" }
}; };
var transparentEndPoint = new TransparentProxyEndPoint(IPAddress.Loopback, 8001, true); var transparentEndPoint = new TransparentProxyEndPoint(IPAddress.Loopback, 8001, true);
ProxyServer.AddEndPoint(explicitEndPoint);
ProxyServer.Start();
//You can also add/remove end points after proxy has been started
ProxyServer.AddEndPoint(transparentEndPoint);
ProxyServer.AddEndPoint(explicitEndPoint); foreach (var endPoint in ProxyServer.ProxyEndPoints)
ProxyServer.AddEndPoint(transparentEndPoint); Console.WriteLine("Listening on '{0}' endpoint at Ip {1} and port: {2} ", endPoint.GetType().Name, endPoint.IpAddress, endPoint.Port);
ProxyServer.Start();
ProxyServer.SetAsSystemProxy(explicitEndPoint); ProxyServer.SetAsSystemHttpProxy(explicitEndPoint);
ProxyServer.SetAsSystemHttpsProxy(explicitEndPoint);
//wait here (You can use something else as a wait function, I am using this as a demo) //wait here (You can use something else as a wait function, I am using this as a demo)
Console.Read(); Console.Read();
......
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