From 463a120d58e76c004114fe24c5ad112d9ceef895 Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Tue, 12 Mar 2024 13:58:31 +0100 Subject: [PATCH] fix sockopt in all protocols --- web/assets/js/model/outbound.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/web/assets/js/model/outbound.js b/web/assets/js/model/outbound.js index 83ef7af3..631a8aca 100644 --- a/web/assets/js/model/outbound.js +++ b/web/assets/js/model/outbound.js @@ -553,11 +553,18 @@ class Outbound extends CommonClass { } toJson() { + var stream; + if (this.canEnableStream()) { + stream = this.stream.toJson(); + } else { + if (this.stream?.sockopt) + stream = { sockopt: this.stream.sockopt.toJson() }; + } return { tag: this.tag == '' ? undefined : this.tag, protocol: this.protocol, settings: this.settings instanceof CommonClass ? this.settings.toJson() : this.settings, - streamSettings: this.canEnableStream() ? this.stream.toJson() : undefined, + streamSettings: stream, mux: this.mux?.enabled ? this.mux : undefined, }; }