Example #1
0
 public void DisableSystemProxy()
 {
     _proxyServer.DisableSystemProxy(ProxyProtocolType.Http);
     _proxyServer.ProxyBasicAuthenticateFunc = BasicAuthenticate;
     IsSystemProxy = false;
     Debug.WriteLine(nameof(DisableSystemProxy));
 }
 /// <summary>
 ///		Detiene el proxy
 /// </summary>
 public void Stop()
 {
     // Limpia las sesiones
     _sessions.Clear();
     // Desactiva el proxy
     _proxyServer.DisableSystemProxy(ProxyProtocolType.AllHttp);
     _proxyServer.DisableAllSystemProxies();
     _proxyServer.BeforeRequest -= OnRequest;
     _proxyServer.Stop();
     // Elimina los certificados
     _proxyServer.CertificateManager.RemoveTrustedRootCertificates();
 }
Example #3
0
        public void Stop()
        {
            explicitEndPoint.BeforeTunnelConnectRequest  -= OnBeforeTunnelConnectRequest;
            explicitEndPoint.BeforeTunnelConnectResponse -= OnBeforeTunnelConnectResponse;

            proxyServer.BeforeRequest  -= OnRequest;
            proxyServer.BeforeResponse -= OnResponse;
            proxyServer.ServerCertificateValidationCallback -= OnCertificateValidation;
            proxyServer.ClientCertificateSelectionCallback  -= OnCertificateSelection;

            proxyServer.Stop();
            if (RunTime.IsWindows)
            {
                proxyServer.DisableSystemProxy(ProxyProtocolType.AllHttp);
            }

            // remove the generated certificates
            //proxyServer.CertificateManager.RemoveTrustedRootCertificates();
        }