mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-24 02:00:24 +07:00
fix: add peers array
This commit is contained in:
@@ -206,6 +206,10 @@ QJsonObject AwgClientConfig::toJson() const
|
|||||||
obj[configKey::isObfuscationEnabled] = isObfuscationEnabled;
|
obj[configKey::isObfuscationEnabled] = isObfuscationEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!peers.isEmpty()) {
|
||||||
|
obj["peers"] = peers;
|
||||||
|
}
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,6 +255,8 @@ AwgClientConfig AwgClientConfig::fromJson(const QJsonObject& json)
|
|||||||
|
|
||||||
config.isObfuscationEnabled = json.value(configKey::isObfuscationEnabled).toBool(false);
|
config.isObfuscationEnabled = json.value(configKey::isObfuscationEnabled).toBool(false);
|
||||||
|
|
||||||
|
config.peers = json.value("peers").toArray();
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#ifndef AWGPROTOCOLCONFIG_H
|
#ifndef AWGPROTOCOLCONFIG_H
|
||||||
#define AWGPROTOCOLCONFIG_H
|
#define AWGPROTOCOLCONFIG_H
|
||||||
|
|
||||||
|
#include <QJsonArray>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
@@ -60,6 +61,7 @@ struct AwgClientConfig {
|
|||||||
QStringList allowedIps;
|
QStringList allowedIps;
|
||||||
QString persistentKeepAlive;
|
QString persistentKeepAlive;
|
||||||
QString mtu;
|
QString mtu;
|
||||||
|
QJsonArray peers;
|
||||||
QString junkPacketCount;
|
QString junkPacketCount;
|
||||||
QString junkPacketMinSize;
|
QString junkPacketMinSize;
|
||||||
QString junkPacketMaxSize;
|
QString junkPacketMaxSize;
|
||||||
|
|||||||
Reference in New Issue
Block a user