mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-22 02:01:08 +07:00
fix: fix local proxy settings and restart logic
- Added local proxy restart token management in Settings. - Implemented logic to handle local proxy state on application quit. - Updated ProxyServer to restart based on configuration changes. - Enhanced API configuration updates to bump restart token when necessary. - Improved UI components to reflect local proxy availability and state. - Added new error handling and notifications for local proxy operations.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "coreController.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDirIterator>
|
||||
#include <QDebug>
|
||||
#include <QTranslator>
|
||||
@@ -41,6 +42,12 @@ void CoreController::initLocalProxy()
|
||||
|
||||
m_proxyServer.reset(new ProxyServer(m_settings, this));
|
||||
|
||||
QObject::connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, this, [this]() {
|
||||
if (m_settings && m_settings->isLocalProxyHttpEnabled()) {
|
||||
m_settings->setLocalProxyHttpEnabled(false);
|
||||
}
|
||||
});
|
||||
|
||||
auto syncLocalProxy = [this]() {
|
||||
if (!m_proxyServer) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user