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