feat: TrafficGuard owns Xray adapter IP swap on Windows

This commit is contained in:
cd-amn
2026-06-15 21:22:06 +04:00
parent e58b7597ec
commit ff1473732c
6 changed files with 116 additions and 0 deletions
+4
View File
@@ -272,11 +272,15 @@ ErrorCode XrayProtocol::setupRouting()
{
return IpcClient::withInterface(
[this](QSharedPointer<IpcInterfaceReplica> iface) -> ErrorCode {
#ifndef Q_OS_WIN
auto createTun = iface->createTun(m_tunName, amnezia::protocols::xray::defaultLocalAddr);
if (!createTun.waitForFinished() || !createTun.returnValue()) {
qCritical() << "Failed to assign IP address for TUN";
return ErrorCode::InternalError;
}
#else
Q_UNUSED(iface)
#endif
emit tunnelAddressesUpdated(m_vpnGateway, m_vpnLocalAddress);
return ErrorCode::NoError;