예제 #1
0
 public void Close()
 {
     Console.WriteLine("Disposing..");
     ps.DisableSystemHttpProxy();
     ps.DisableSystemHttpsProxy();
     ps.Dispose();
 }
예제 #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();
     }
 }