mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-22 02:01:08 +07:00
38 lines
890 B
C++
38 lines
890 B
C++
#pragma once
|
|
|
|
#include "configmanager.h"
|
|
#include "iproxyservice.h"
|
|
#include "xraycontroller.h"
|
|
|
|
#include <QObject>
|
|
#include <QScopedPointer>
|
|
#include <QJsonObject>
|
|
#include <memory>
|
|
|
|
class Settings;
|
|
|
|
class ProxyService : public QObject, public IProxyService {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit ProxyService(const std::shared_ptr<Settings> &settings, QObject* parent = nullptr);
|
|
~ProxyService() = default;
|
|
|
|
QJsonObject getConfig() override;
|
|
bool startXray() override;
|
|
bool stopXray() override;
|
|
bool isXrayRunning() const override;
|
|
qint64 getXrayProcessId() const override;
|
|
QString getXrayError() const override;
|
|
|
|
void clearCache();
|
|
bool restartXray();
|
|
|
|
signals:
|
|
void xrayStatusChanged(bool running);
|
|
|
|
private:
|
|
QScopedPointer<ConfigManager> m_configManager;
|
|
QScopedPointer<XrayController> m_xrayController;
|
|
QJsonObject m_cachedConfig;
|
|
};
|