parent
f6acec53c0
commit
ba4237f1dd
64 changed files with 1933 additions and 336 deletions
41
client/protocols/xrayprotocol.h
Normal file
41
client/protocols/xrayprotocol.h
Normal file
|
@ -0,0 +1,41 @@
|
|||
#ifndef XRAYPROTOCOL_H
|
||||
#define XRAYPROTOCOL_H
|
||||
|
||||
#include "openvpnprotocol.h"
|
||||
#include "QProcess"
|
||||
#include "containers/containers_defs.h"
|
||||
|
||||
class XrayProtocol : public VpnProtocol
|
||||
{
|
||||
public:
|
||||
XrayProtocol(const QJsonObject& configuration, QObject* parent = nullptr);
|
||||
virtual ~XrayProtocol() override;
|
||||
|
||||
ErrorCode start() override;
|
||||
ErrorCode startTun2Sock();
|
||||
void stop() override;
|
||||
|
||||
protected:
|
||||
void readXrayConfiguration(const QJsonObject &configuration);
|
||||
|
||||
protected:
|
||||
QJsonObject m_xrayConfig;
|
||||
|
||||
private:
|
||||
static QString xrayExecPath();
|
||||
static QString tun2SocksExecPath();
|
||||
private:
|
||||
int m_localPort;
|
||||
QString m_remoteAddress;
|
||||
int m_routeMode;
|
||||
QJsonObject m_configData;
|
||||
QString m_primaryDNS;
|
||||
QString m_secondaryDNS;
|
||||
#ifndef Q_OS_IOS
|
||||
QProcess m_xrayProcess;
|
||||
QSharedPointer<PrivilegedProcess> m_t2sProcess;
|
||||
#endif
|
||||
QTemporaryFile m_xrayCfgFile;
|
||||
};
|
||||
|
||||
#endif // XRAYPROTOCOL_H
|
Loading…
Add table
Add a link
Reference in a new issue