mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-22 02:01:08 +07:00
412e69af9b
- Modified ConfigManager to accept a Settings object for improved configuration management. - Updated ProxyServer to initialize with Settings, enhancing dependency injection.
32 lines
609 B
C++
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};
|
|
}; |