Beispiel #1
0
 public void Close()
 {
     Console.WriteLine("Disposing..");
     ps.DisableSystemHttpProxy();
     ps.DisableSystemHttpsProxy();
     ps.Dispose();
 }
Beispiel #2
0
 public void StopProxy()
 {
     if (proxyServer.ProxyRunning)
     {
         proxyServer.BeforeRequest  -= OnRequest;
         proxyServer.BeforeResponse -= OnResponse;
         //proxyServer.ServerCertificateValidationCallback -= OnCertificateValidation;
         //proxyServer.ClientCertificateSelectionCallback -= OnCertificateSelection;
         proxyServer.DisableSystemHttpProxy();
         proxyServer.DisableSystemHttpsProxy();
         proxyServer.Stop();
         hostsService.RemoveHostsByTag();
     }
 }