From a84c055fd802c04ab3063a2e8593cd228e7b867b Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Sun, 1 Sep 2024 11:37:22 +0200 Subject: [PATCH] update splithttp Co-Authored-By: mhsanaei --- web/assets/js/model/xray.js | 34 ++++++++++++++----- .../xui/form/stream/stream_splithttp.html | 17 +++++++--- 2 files changed, 39 insertions(+), 12 deletions(-) diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js index 801e9f1e..ea35358f 100644 --- a/web/assets/js/model/xray.js +++ b/web/assets/js/model/xray.js @@ -477,13 +477,25 @@ class HttpUpgradeStreamSettings extends XrayCommonClass { } } class SplitHTTPStreamSettings extends XrayCommonClass { - constructor(path='/', host='', headers=[] , maxUploadSize= 1000000, maxConcurrentUploads= 10) { + constructor( + path = '/', + host = '', + headers = [], + scMaxConcurrentPosts = "100-200", + scMaxEachPostBytes = "1000000-2000000", + scMinPostsIntervalMs = "10-50", + noSSEHeader = false, + xPaddingBytes = "100-1000", + ) { super(); this.path = path; this.host = host; this.headers = headers; - this.maxUploadSize = maxUploadSize; - this.maxConcurrentUploads = maxConcurrentUploads; + this.scMaxConcurrentPosts = scMaxConcurrentPosts; + this.scMaxEachPostBytes = scMaxEachPostBytes; + this.scMinPostsIntervalMs = scMinPostsIntervalMs; + this.noSSEHeader = noSSEHeader; + this.xPaddingBytes = xPaddingBytes; } addHeader(name, value) { @@ -494,13 +506,16 @@ class SplitHTTPStreamSettings extends XrayCommonClass { this.headers.splice(index, 1); } - static fromJson(json={}) { + static fromJson(json = {}) { return new SplitHTTPStreamSettings( json.path, json.host, XrayCommonClass.toHeaders(json.headers), - json.maxUploadSize, - json.maxConcurrentUploads, + json.scMaxConcurrentPosts, + json.scMaxEachPostBytes, + json.scMinPostsIntervalMs, + json.noSSEHeader, + json.xPaddingBytes, ); } @@ -509,8 +524,11 @@ class SplitHTTPStreamSettings extends XrayCommonClass { path: this.path, host: this.host, headers: XrayCommonClass.toV2Headers(this.headers, false), - maxUploadSize: this.maxUploadSize, - maxConcurrentUploads: this.maxConcurrentUploads, + scMaxConcurrentPosts: this.scMaxConcurrentPosts, + scMaxEachPostBytes: this.scMaxEachPostBytes, + scMinPostsIntervalMs: this.scMinPostsIntervalMs, + noSSEHeader: this.noSSEHeader, + xPaddingBytes: this.xPaddingBytes, }; } } diff --git a/web/html/xui/form/stream/stream_splithttp.html b/web/html/xui/form/stream/stream_splithttp.html index 44c8900a..bf706922 100644 --- a/web/html/xui/form/stream/stream_splithttp.html +++ b/web/html/xui/form/stream/stream_splithttp.html @@ -19,11 +19,20 @@ - - - - + + + + + + + + + + + + + {{end}}