Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormhsanaei <ho3ein.sanaei@gmail.com>2025-09-20 12:11:30 +0300
committermhsanaei <ho3ein.sanaei@gmail.com>2025-09-20 14:10:57 +0300
commit37c17357fc45b9acec387f3097be5db074ce880d (patch)
treea3a5aa82c7483c0883070185372c491537173c25 /web/assets
parentb35d33966589f428053b77f51a92ec0214bd92fb (diff)
undo vnext for vmess
Diffstat (limited to 'web/assets')
-rw-r--r--web/assets/js/model/outbound.js36
1 files changed, 18 insertions, 18 deletions
diff --git a/web/assets/js/model/outbound.js b/web/assets/js/model/outbound.js
index 3e481dff..c727abae 100644
--- a/web/assets/js/model/outbound.js
+++ b/web/assets/js/model/outbound.js
@@ -686,14 +686,7 @@ class Outbound extends CommonClass {
if (this.stream?.sockopt)
stream = { sockopt: this.stream.sockopt.toJson() };
}
- // For VMess/VLESS, emit settings as a flat object
let settingsOut = this.settings instanceof CommonClass ? this.settings.toJson() : this.settings;
- // Remove undefined/null keys
- if (settingsOut && typeof settingsOut === 'object') {
- Object.keys(settingsOut).forEach(k => {
- if (settingsOut[k] === undefined || settingsOut[k] === null) delete settingsOut[k];
- });
- }
return {
protocol: this.protocol,
settings: settingsOut,
@@ -1031,21 +1024,28 @@ Outbound.VmessSettings = class extends CommonClass {
}
static fromJson(json = {}) {
- if (ObjectUtil.isEmpty(json.address) || ObjectUtil.isEmpty(json.port)) return new Outbound.VmessSettings();
- return new Outbound.VmessSettings(
- json.address,
- json.port,
- json.id,
- json.security,
- );
+ if (!ObjectUtil.isArrEmpty(json.vnext)) {
+ const v = json.vnext[0] || {};
+ const u = ObjectUtil.isArrEmpty(v.users) ? {} : v.users[0];
+ return new Outbound.VmessSettings(
+ v.address,
+ v.port,
+ u.id,
+ u.security,
+ );
+ }
}
toJson() {
return {
- address: this.address,
- port: this.port,
- id: this.id,
- security: this.security,
+ vnext: [{
+ address: this.address,
+ port: this.port,
+ users: [{
+ id: this.id,
+ security: this.security
+ }]
+ }]
};
}
};