mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-20 02:00:55 +07:00
54f67b3d82
* feat: integrated xray as a library and added split-tunneling * fix: added copying amnezia_xray.dll to build dir * fix: changed path on darwin * chore: clean up getting default device * chore: removed WSAGetLastError from sockopt logging * fix: get rid of debug logs in xray handlers * fix: minor fixes and xray debugging capabilities * fix: macos default interface fix * fix: roll-back ipv6 sockopt for mac * fix: bind IPv6 on Windows * fix: (win) better IPv6 handling and router fixes * feat: prebuilts uploaded * fix: removed redundant cmake definitions * feat: moved xray to service process, reworked errors * fix: return values in networkUtilities * fix: macos build fixes * fix: (windows) cmake fixes * fix: (windows) compilation fix * fix: (windows) changed location of amnezia_xray.dll * feat: xray logs added to system service * chore: bump xray&tun2socks versions for android * chore: cleanup of XrayProtocol class * removed killswitch * removed redundant members and basic cleanup * feat: support split-tunneling in iOS and macOS NE * chore: update active interface index based on network path and available interfaces * refactor: update network path handling and logging in PacketTunnelProvider * chore: bump xray deps --------- Co-authored-by: Yaroslav Yashin <yaroslav.yashin@gmail.com>
37 lines
663 B
C++
37 lines
663 B
C++
#ifndef XRAY_H
|
|
#define XRAY_H
|
|
|
|
#include <QString>
|
|
|
|
class Xray
|
|
{
|
|
public:
|
|
static Xray& getInstance()
|
|
{
|
|
static Xray instance;
|
|
return instance;
|
|
}
|
|
|
|
void startXray(const QString& cfg);
|
|
void stopXray();
|
|
|
|
private:
|
|
static void ctxSockCallback(uintptr_t fd, void* ctx) {
|
|
reinterpret_cast<Xray*>(ctx)->sockCallback(fd);
|
|
}
|
|
static void ctxLogHandler(char* str, void* ctx) {
|
|
reinterpret_cast<Xray*>(ctx)->logHandler(str);
|
|
}
|
|
|
|
void sockCallback(uintptr_t fd);
|
|
void logHandler(char* str);
|
|
|
|
#ifdef Q_OS_LINUX
|
|
QByteArray m_defaultIfaceName;
|
|
#else
|
|
int m_defaultIfaceIdx;
|
|
#endif
|
|
};
|
|
|
|
#endif // XRAY_H
|