Update() public static method

public static Update ( Configuration config, bool forceDisable, PACServer pacSrv ) : void
config Shadowsocks.Model.Configuration
forceDisable bool
pacSrv PACServer
return void
 public void Stop()
 {
     if (_v2rayProcess != null)
     {
         _v2rayProcess.Kill();
         _v2rayProcess.WaitForExit();
         _v2rayProcess = null;
     }
     if (stopped)
     {
         return;
     }
     stopped = true;
     if (_listener != null)
     {
         _listener.Stop();
     }
     if (polipoRunner != null)
     {
         polipoRunner.Stop();
     }
     if (_config.enabled)
     {
         SystemProxy.Update(_config, true);
     }
 }
 private void UpdateSystemProxy()
 {
     if (_config.sysProxyMode != (int)ProxyMode.NoModify)
     {
         SystemProxy.Update(_config, false, _pacServer);
     }
 }
        public void Stop()
        {
            if (stopped)
            {
                return;
            }
            stopped = true;

            if (_port_map_listener != null)
            {
                foreach (var l in _port_map_listener)
                {
                    l.Stop();
                }
                _port_map_listener = null;
            }

            _listener?.Stop();
            privoxyRunner?.Stop();
            if (_config.sysProxyMode != (int)ProxyMode.NoModify && _config.sysProxyMode != (int)ProxyMode.Direct)
            {
                SystemProxy.Update(_config, true, null);
            }
            ServerTransferTotal.Save(_transfer);
        }
 public void Stop()
 {
     if (stopped)
     {
         return;
     }
     Process[] myproc = Process.GetProcessesByName(System.Configuration.ConfigurationManager.AppSettings["kcptunName"]);
     foreach (Process item in myproc)
     {
         item.Kill();
     }
     stopped = true;
     if (_listener != null)
     {
         _listener.Stop();
     }
     StopPlugins();
     if (privoxyRunner != null)
     {
         privoxyRunner.Stop();
     }
     if (_config.enabled)
     {
         SystemProxy.Update(_config, true, null);
     }
     Encryption.RNG.Close();
 }
        public void Stop()
        {
            if (stopped)
            {
                return;
            }
            stopped = true;

            if (_port_map_listener != null)
            {
                foreach (Listener l in _port_map_listener)
                {
                    l.Stop();
                }
                _port_map_listener = null;
            }
            if (_listener != null)
            {
                _listener.Stop();
            }
#if !_CONSOLE
            if (polipoRunner != null)
            {
                polipoRunner.Stop();
            }
            if (_config.sysProxyMode != (int)ProxyMode.NoModify && _config.sysProxyMode != (int)ProxyMode.Direct)
            {
                SystemProxy.Update(_config, true);
            }
#endif
            ServerTransferTotal.Save(_transfer);
        }
 public void Stop()
 {
     /*****************************************************<Start> add by Ian.May 2016/10/15***********************************/
     //_configBackup keeps the previous _config infomation ,and use _config for recieving fognode server infomation.
     //When exit(finish connection),we should erase the shadowfog server configs and put the orignial _config back
     RecoverSSConfig();           //_configBackup.configs ==> _config.configs, then save _config;
     Configuration.Save(_config); // correct opertation because this save extra configuration other than server infomation
     /******************************************************<End> add by Ian.May 2016/10/15************************************/
     if (stopped)
     {
         return;
     }
     stopped = true;
     if (_listener != null)
     {
         _listener.Stop();
     }
     if (privoxyRunner != null)
     {
         privoxyRunner.Stop();
     }
     if (_config.enabled)
     {
         SystemProxy.Update(_config, true, null);
     }
     Encryption.RNG.Close();
 }
        private void UpdateSystemProxy()
        {
#if !_CONSOLE
            if (_config.sysProxyMode != (int)ProxyMode.NoModify)
            {
                SystemProxy.Update(_config, false);
            }
#endif
        }
 public void Stop()
 {
     if (stopped)
     {
         return;
     }
     stopped = true;
     _listener?.Stop();
     StopPlugins();
     privoxyRunner?.Stop();
     if (_config.enabled)
     {
         SystemProxy.Update(_config, true);
     }
     Encryption.RNG.Close();
 }
        public void Stop()
        {
            _config = Configuration.Load();
            if (_listener != null)
            {
                _listener.Stop();
            }
            StopPlugins();
            if (privoxyRunner != null)
            {
                privoxyRunner.Stop();
            }

            SystemProxy.Update(_config, true, null);
            Encryption.RNG.Close();
        }
 private void UpdateSystemProxy()
 {
     if (_config.enabled)
     {
         SystemProxy.Update(_config, false);
         _systemProxyIsDirty = true;
     }
     else
     {
         // only switch it off if we have switched it on
         if (_systemProxyIsDirty)
         {
             SystemProxy.Update(_config, false);
             _systemProxyIsDirty = false;
         }
     }
 }
Example #11
0
 public void Stop()
 {
     if (stopped)
     {
         return;
     }
     stopped = true;
     if (_listener != null)
     {
         _listener.Stop();
     }
     if (_config.enabled)
     {
         SystemProxy.Update(_config, true, null);
     }
     Encryption.RNG.Close();
 }
 public void Stop()
 {
     if (stopped)
     {
         return;
     }
     stopped = true;
     _pacServer.Stop();
     if (privoxyRunner != null)
     {
         privoxyRunner.Stop();
     }
     if (_config.enabled)
     {
         SystemProxy.Update(_config, true, null);
     }
     Encryption.RNG.Close();
 }
Example #13
0
 public void Stop()
 {
     if (stopped)
     {
         return;
     }
     stopped = true;
     _tcpListener?.Stop();
     _udpListener?.Stop();
     StopPlugins();
     if (privoxyRunner != null)
     {
         privoxyRunner.Stop();
     }
     if (_config.enabled)
     {
         SystemProxy.Update(_config, true, null);
     }
 }
        private void UpdateSystemProxy()
        {
#if !_CONSOLE
            if (_config.sysProxyMode != (int)ProxyMode.NoModify)
            {
                SystemProxy.Update(_config, false);
                _systemProxyIsDirty = true;
            }
            else
            {
                // only switch it off if we have switched it on
                if (_systemProxyIsDirty)
                {
                    SystemProxy.Update(_config, false);
                    _systemProxyIsDirty = false;
                }
            }
#endif
        }
Example #15
0
        public ShadowsocksController()
        {
/***************************************************<Start> add by Ian.May 2016/10/15****************************************************/
// for destructing fogNodes at closing stage, should not be handed from _config;(shallow copy)
/***************************************************<Start> add by Ian.May 2016/10/15****************************************************/
            _configBackup      = Configuration.Load();
            _clientUser        = ClientUser.Load();
            isShadowFogMode    = true;
            isInitialStartup   = true;
            isShadowFogStarted = false;

            SystemProxy.Update(_configBackup, true);// forcedisable = true ,means force _config.enabled = false to update(close) system proxy;
/****************************************************<End> add by Ian.May 2016/10/15*****************************************************/

            _config = Configuration.Load();
            StatisticsConfiguration = StatisticsStrategyConfiguration.Load();
            _strategyManager        = new StrategyManager(this);
            StartReleasingMemory();
            StartTrafficStatistics(61);
        }
 public void Stop()
 {
     if (stopped)
     {
         return;
     }
     stopped = true;
     if (_listener != null)
     {
         _listener.Stop();
     }
     if (polipoRunner != null)
     {
         polipoRunner.Stop();
     }
     if (_config.enabled)
     {
         SystemProxy.Update(_config, true);
     }
 }
        private void UpdateSystemProxy()
        {
#if !_CONSOLE
            SystemProxy.Update(_config, false);
#endif
        }
 private void UpdateSystemProxy()
 {
     SystemProxy.Update(_config, false, _pacServer);
 }
 private void UpdateSystemProxy()
 {
     SystemProxy.Update(Global.GuiConfig, _pacServer);
 }