mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
feat: integrated xray as a library
This commit is contained in:
@@ -3,9 +3,10 @@
|
||||
|
||||
#include "QProcess"
|
||||
|
||||
#include "containers/containers_defs.h"
|
||||
#include "openvpnprotocol.h"
|
||||
#include "protocols/vpnprotocol.h"
|
||||
#include "rep_ipc_process_tun2socks_replica.h"
|
||||
#include "settings.h"
|
||||
#include <cstdint>
|
||||
|
||||
class XrayProtocol : public VpnProtocol
|
||||
{
|
||||
@@ -24,10 +25,16 @@ protected:
|
||||
QJsonObject m_xrayConfig;
|
||||
|
||||
private:
|
||||
static QString xrayExecPath();
|
||||
static QString tun2SocksExecPath();
|
||||
static void ctxSockCallback(uintptr_t fd, void* ctx) {
|
||||
reinterpret_cast<XrayProtocol*>(ctx)->sockCallback(fd);
|
||||
}
|
||||
static void ctxLogHandler(char* str, void* ctx) {
|
||||
reinterpret_cast<XrayProtocol*>(ctx)->logHandler(str);
|
||||
}
|
||||
|
||||
void sockCallback(uintptr_t fd);
|
||||
void logHandler(char* str);
|
||||
|
||||
private:
|
||||
int m_localPort;
|
||||
QString m_remoteHost;
|
||||
QString m_remoteAddress;
|
||||
|
||||
Reference in New Issue
Block a user