public async Task StopAsync() { if (stopped) { return; } stopped = true; await Task.Delay(10); v2rayRunner?.Stop(); privoxyRunner?.Stop(); pacServer?.Stop(); if (_config.enabled) { SystemProxy.Update(_config, 0, true); } }
private void UpdateSystemProxy() { if (_config.enabled) { SystemProxy.Update(_config, pacServer.RunningPort, false); _systemProxyIsDirty = true; } else { // only switch it off if we have switched it on if (_systemProxyIsDirty) { SystemProxy.Update(_config, pacServer.RunningPort, false); _systemProxyIsDirty = false; } } }