2024-03-27 11:02:34 +00:00
|
|
|
#ifndef XRAYPROTOCOL_H
|
|
|
|
|
#define XRAYPROTOCOL_H
|
|
|
|
|
|
|
|
|
|
#include "QProcess"
|
2025-01-27 11:59:56 +07:00
|
|
|
|
2025-12-15 14:54:34 +01:00
|
|
|
#include "core/ipcclient.h"
|
|
|
|
|
#include "vpnprotocol.h"
|
2025-01-27 11:59:56 +07:00
|
|
|
#include "settings.h"
|
2026-02-11 16:47:28 +01:00
|
|
|
#include <QtCore/qsharedpointer.h>
|
2024-03-27 11:02:34 +00:00
|
|
|
|
|
|
|
|
class XrayProtocol : public VpnProtocol
|
|
|
|
|
{
|
|
|
|
|
public:
|
2025-01-27 11:59:56 +07:00
|
|
|
XrayProtocol(const QJsonObject &configuration, QObject *parent = nullptr);
|
2024-03-27 11:02:34 +00:00
|
|
|
virtual ~XrayProtocol() override;
|
|
|
|
|
|
|
|
|
|
ErrorCode start() override;
|
|
|
|
|
void stop() override;
|
|
|
|
|
|
2025-12-15 14:54:34 +01:00
|
|
|
private:
|
2026-02-04 05:35:53 +01:00
|
|
|
ErrorCode setupRouting();
|
2026-02-11 16:47:28 +01:00
|
|
|
ErrorCode startTun2Socks();
|
|
|
|
|
|
2024-03-27 11:02:34 +00:00
|
|
|
QJsonObject m_xrayConfig;
|
2025-01-27 11:59:56 +07:00
|
|
|
Settings::RouteMode m_routeMode;
|
2026-02-11 16:47:28 +01:00
|
|
|
QList<QHostAddress> m_dnsServers;
|
|
|
|
|
QString m_remoteAddress;
|
|
|
|
|
|
2026-04-13 15:06:08 +03:00
|
|
|
QString m_socksUser;
|
|
|
|
|
QString m_socksPassword;
|
|
|
|
|
int m_socksPort = 10808;
|
|
|
|
|
|
2026-02-11 16:47:28 +01:00
|
|
|
QSharedPointer<IpcProcessInterfaceReplica> m_tun2socksProcess;
|
2024-03-27 11:02:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // XRAYPROTOCOL_H
|