diff options
| author | Alireza Ahmadi <alireza7@gmail.com> | 2025-08-09 17:07:33 +0300 |
|---|---|---|
| committer | Alireza Ahmadi <alireza7@gmail.com> | 2025-08-09 17:07:33 +0300 |
| commit | d5c532c64f1b068cb6baa7c34698059c1abcb8d9 (patch) | |
| tree | df948505a35b93f6d30c9558a54170dd5156a461 /web | |
| parent | ad5f774a1e1c27fb39b2f5c7c2d8fe356bbec530 (diff) | |
fix saving sockopt
Diffstat (limited to 'web')
| -rw-r--r-- | web/assets/js/model/inbound.js | 2 | ||||
| -rw-r--r-- | web/html/inbounds.html | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/web/assets/js/model/inbound.js b/web/assets/js/model/inbound.js index aebf321a..803b5d94 100644 --- a/web/assets/js/model/inbound.js +++ b/web/assets/js/model/inbound.js @@ -1710,7 +1710,7 @@ class Inbound extends XrayCommonClass { toJson() { let streamSettings; - if (this.canEnableStream()) { + if (this.canEnableStream() || this.stream?.sockopt) { streamSettings = this.stream.toJson(); } return { diff --git a/web/html/inbounds.html b/web/html/inbounds.html index e2b98d49..58d2d07a 100644 --- a/web/html/inbounds.html +++ b/web/html/inbounds.html @@ -1119,7 +1119,11 @@ protocol: inbound.protocol, settings: inbound.settings.toString(), }; - if (inbound.canEnableStream()) data.streamSettings = inbound.stream.toString(); + if (inbound.canEnableStream()){ + data.streamSettings = inbound.stream.toString(); + } else if (inbound.stream?.sockopt) { + data.streamSettings = JSON.stringify({ sockopt: inbound.stream.sockopt.toJson() }, null, 2); + } data.sniffing = inbound.sniffing.toString(); data.allocate = inbound.allocate.toString(); @@ -1139,7 +1143,11 @@ protocol: inbound.protocol, settings: inbound.settings.toString(), }; - if (inbound.canEnableStream()) data.streamSettings = inbound.stream.toString(); + if (inbound.canEnableStream()){ + data.streamSettings = inbound.stream.toString(); + } else if (inbound.stream?.sockopt) { + data.streamSettings = JSON.stringify({ sockopt: inbound.stream.sockopt.toJson() }, null, 2); + } data.sniffing = inbound.sniffing.toString(); data.allocate = inbound.allocate.toString(); |
