فهرست منبع

fix sockopt in all protocols

Co-Authored-By: Alireza Ahmadi <[email protected]>
MHSanaei 1 سال پیش
والد
کامیت
6fdc07a2d0
1فایلهای تغییر یافته به همراه8 افزوده شده و 1 حذف شده
  1. 8 1
      web/assets/js/model/outbound.js

+ 8 - 1
web/assets/js/model/outbound.js

@@ -578,11 +578,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,
         };
     }