Files
amnezia-client/client/core/local-proxy/proxyserver.h
T
aiamnezia 412e69af9b feat: update ConfigManager and ProxyServer to utilize Settings
- Modified ConfigManager to accept a Settings object for improved configuration management.
- Updated ProxyServer to initialize with Settings, enhancing dependency injection.
2025-12-31 21:16:45 +04:00

32 lines
609 B
C++

#pragma once
#include <QObject>
#include <QScopedPointer>
#include <QSharedPointer>
#include <memory>
#include "httpapi.h"
#include "proxyservice.h"
class Settings;
class ProxyServer : public QObject
{
Q_OBJECT
public:
explicit ProxyServer(const std::shared_ptr<Settings> &settings, QObject *parent = nullptr);
~ProxyServer();
bool start(quint16 port = 8080);
void stop();
private:
bool startXrayProcess();
void stopXrayProcess();
QScopedPointer<HttpApi> m_api;
QSharedPointer<ProxyService> m_service;
bool m_isRunning {false};
quint16 m_currentPort {0};
};