diff --git a/web/assets/js/model/outbound.js b/web/assets/js/model/outbound.js
index c6f5bf50..89032514 100644
--- a/web/assets/js/model/outbound.js
+++ b/web/assets/js/model/outbound.js
@@ -8,6 +8,7 @@ const Protocols = {
Shadowsocks: "shadowsocks",
Socks: "socks",
HTTP: "http",
+ Wireguard: "wireguard"
};
const SSMethods = {
@@ -625,6 +626,7 @@ Outbound.Settings = class extends CommonClass {
case Protocols.Shadowsocks: return new Outbound.ShadowsocksSettings();
case Protocols.Socks: return new Outbound.SocksSettings();
case Protocols.HTTP: return new Outbound.HttpSettings();
+ case Protocols.Wireguard: return new Outbound.WireguardSettings();
default: return null;
}
}
@@ -640,6 +642,7 @@ Outbound.Settings = class extends CommonClass {
case Protocols.Shadowsocks: return Outbound.ShadowsocksSettings.fromJson(json);
case Protocols.Socks: return Outbound.SocksSettings.fromJson(json);
case Protocols.HTTP: return Outbound.HttpSettings.fromJson(json);
+ case Protocols.Wireguard: return Outbound.WireguardSettings.fromJson(json);
default: return null;
}
}
@@ -897,4 +900,43 @@ Outbound.HttpSettings = class extends CommonClass {
}],
};
}
+};
+Outbound.WireguardSettings = class extends CommonClass{
+ constructor(mtu=1420, secretKey='', address='', publicKey='', allowedIPs='0.0.0.0/0,::/0', endpoint='', keepAlive=0) {
+ super();
+ this.mtu = mtu,
+ this.secretKey = secretKey,
+ this.address = address,
+ this.publicKey = publicKey,
+ this.allowedIPs = allowedIPs,
+ this.endpoint = endpoint,
+ this.keepAlive = keepAlive
+ }
+
+ static fromJson(json={}){
+ const peers = json.peers
+ return new Outbound.WireguardSettings(
+ json.mtu,
+ json.secretKey,
+ json.address.toString(),
+ peers[0].publicKey,
+ peers[0].allowedIPs.toString(),
+ peers[0].endpoint,
+ peers[0].keepAlive
+ );
+ }
+
+ toJson() {
+ return {
+ mtu: this.mtu,
+ secretKey: this.secretKey,
+ address: this.address ? this.address.split(",") : [],
+ peers: [{
+ publicKey:this.publicKey,
+ allowedIPs: this.allowedIPs ? this.allowedIPs.split(",") : [],
+ keepAlive: this.keepAlive,
+ endpoint: this.endpoint
+ }]
+ };
+ }
};
\ No newline at end of file
diff --git a/web/html/xui/form/outbound.html b/web/html/xui/form/outbound.html
index a5bfe3fd..4cc77ac9 100644
--- a/web/html/xui/form/outbound.html
+++ b/web/html/xui/form/outbound.html
@@ -66,6 +66,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/web/translation/translate.en_US.toml b/web/translation/translate.en_US.toml
index a697b3a3..554eb514 100644
--- a/web/translation/translate.en_US.toml
+++ b/web/translation/translate.en_US.toml
@@ -388,6 +388,10 @@
"bridge" = "Bridge"
"portal" = "Portal"
"intercon" = "Interconnection"
+"secretKey" = "Secret Key"
+"publicKey" = "Public Key"
+"allowedIPs" = "Allowed IPs"
+"endpoint" = "End Point"
[tgbot]
"noResult" = "❗ No result!"
diff --git a/web/translation/translate.fa_IR.toml b/web/translation/translate.fa_IR.toml
index 9870145f..79a33009 100644
--- a/web/translation/translate.fa_IR.toml
+++ b/web/translation/translate.fa_IR.toml
@@ -387,6 +387,10 @@
"bridge" = "پل"
"portal" = "پرتال"
"intercon" = "اتصال میانی"
+"secretKey" = "کلید شخصی"
+"publicKey" = "کلید عمومی"
+"allowedIPs" = "های مجاز IP"
+"endpoint" = "نقطه پایانی"
[tgbot]
"noResult" = "❗ نتیجهای یافت نشد!"
diff --git a/web/translation/translate.ru_RU.toml b/web/translation/translate.ru_RU.toml
index 38b40dd0..b93fa7b0 100644
--- a/web/translation/translate.ru_RU.toml
+++ b/web/translation/translate.ru_RU.toml
@@ -388,6 +388,10 @@
"bridge" = "Мост"
"portal" = "Портал"
"intercon" = "Соединение"
+"secretKey" = "Секретный ключ"
+"publicKey" = "Открытый ключ"
+"allowedIPs" = "Разрешенные IP-адреса"
+"endpoint" = "Конечная точка"
[tgbot]
"noResult" = "❗ Нет результатов!"
diff --git a/web/translation/translate.vi_VN.toml b/web/translation/translate.vi_VN.toml
index 5382769c..5708f25e 100644
--- a/web/translation/translate.vi_VN.toml
+++ b/web/translation/translate.vi_VN.toml
@@ -388,6 +388,10 @@
"bridge" = "Liên kết"
"portal" = "Cổng thông tin"
"intercon" = "Kết nối"
+"secretKey" = "Chìa khoá bí mật"
+"publicKey" = "Khóa công khai"
+"allowedIPs" = "IP được phép"
+"endpoint" = "Điểm cuối"
[tgbot]
"noResult" = "❗ Không có kết quả!"
diff --git a/web/translation/translate.zh_Hans.toml b/web/translation/translate.zh_Hans.toml
index 96a0126a..c836bc07 100644
--- a/web/translation/translate.zh_Hans.toml
+++ b/web/translation/translate.zh_Hans.toml
@@ -388,6 +388,10 @@
"bridge" = "桥"
"portal" = "门户"
"intercon" = "互连"
+"secretKey" = "密钥"
+"publicKey" = "公钥"
+"allowedIPs" = "允许的 IP"
+"endpoint" = "终点"
[tgbot]
"noResult" = "❗ 没有结果!"