Esempio n. 1
0
        public static void Stop()
        {
            if (!proxyRunning)
            {
                throw new Exception("Proxy is not running.");
            }

            var setAsSystemProxy = ProxyEndPoints.OfType <ExplicitProxyEndPoint>().Any(x => x.IsSystemHttpProxy || x.IsSystemHttpsProxy);

            if (setAsSystemProxy)
            {
                SystemProxyHelper.DisableAllProxy();
#if !DEBUG
                FireFoxHelper.RemoveFirefox();
#endif
            }

            foreach (var endPoint in ProxyEndPoints)
            {
                endPoint.listener.Stop();
            }

            CertManager.Dispose();

            Quit();

            proxyRunning = false;
        }
Esempio n. 2
0
        private void FormMain_FormClosed(object sender, FormClosedEventArgs e)
        {
#if !DEBUG
//            if (Properties.Settings.Default.isProtected)
            //ProxyRoutines.SetProxy(false);
            SystemProxyHelper.DisableAllProxy();
            FireFoxHelper.RemoveFirefox();
#endif
            log.Info("FormMain_FormClosed Unset Proxy!");
        }
Esempio n. 3
0
        public static void Stop()
        {
            if (SetAsSystemProxy)
            {
                SystemProxyHelper.DisableAllProxy();
                FireFoxHelper.RemoveFirefox();
            }

            _listener.Stop();
            CertManager.Dispose();
        }
Esempio n. 4
0
        public static void Stop()
        {
            if (SetAsSystemProxy)
            {
                SystemProxyHelper.DisableAllProxy();
                FireFoxHelper.RemoveFirefox();
            }

            ShouldListen = false;
            listener.Stop();
            listenerThread.Interrupt();
        }
Esempio n. 5
0
        private void TurnOffProxy()
        {
            if (WechatForm.Auth())
            {
#if !DEBUG
                //ProxyRoutines.SetProxy(false);
                SystemProxyHelper.DisableAllProxy();
                FireFoxHelper.RemoveFirefox();
#endif
                //notify_icon_main.Icon = Properties.Resources.off;
                tool_strip_menu_item_toggle_onff.Checked = false;
                //toggleOnOffButton.Image = Properties.Resources.powerblack_small;
                Properties.Settings.Default.isProtected = false;
                Properties.Settings.Default.Save();
                //同时设置
                TurnOffAutoStart();
            }
        }
Esempio n. 6
0
 public static void DisableAllSystemProxies()
 {
     SystemProxyHelper.DisableAllProxy();
 }