Skip to content

Commit

Permalink
new - splithttp (noSSEHeader)
Browse files Browse the repository at this point in the history
  • Loading branch information
MHSanaei committed Jul 29, 2024
1 parent 4ec104c commit fdfc29f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
15 changes: 13 additions & 2 deletions web/assets/js/model/xray.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,14 +523,23 @@ class HTTPUpgradeStreamSettings extends XrayCommonClass {
}

class SplitHTTPStreamSettings extends XrayCommonClass {
constructor(path='/', host='', headers=[] , scMaxConcurrentPosts= 100, scMaxEachPostBytes= 1000000, scMinPostsIntervalMs= 30) {
constructor(
path = '/',
host = '',
headers = [],
scMaxConcurrentPosts = 100,
scMaxEachPostBytes = 1000000,
scMinPostsIntervalMs = 30,
noSSEHeader = false,
) {
super();
this.path = path;
this.host = host;
this.headers = headers;
this.scMaxConcurrentPosts = scMaxConcurrentPosts;
this.scMaxEachPostBytes = scMaxEachPostBytes;
this.scMinPostsIntervalMs = scMinPostsIntervalMs;
this.noSSEHeader = noSSEHeader;
}

addHeader(name, value) {
Expand All @@ -541,14 +550,15 @@ 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.scMaxConcurrentPosts,
json.scMaxEachPostBytes,
json.scMinPostsIntervalMs,
json.noSSEHeader,
);
}

Expand All @@ -560,6 +570,7 @@ class SplitHTTPStreamSettings extends XrayCommonClass {
scMaxConcurrentPosts: this.scMaxConcurrentPosts,
scMaxEachPostBytes: this.scMaxEachPostBytes,
scMinPostsIntervalMs: this.scMinPostsIntervalMs,
noSSEHeader: this.noSSEHeader,
};
}
}
Expand Down
5 changes: 4 additions & 1 deletion web/html/xui/form/stream/stream_splithttp.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@
<a-form-item label="Max Upload Size (Byte)">
<a-input-number v-model="inbound.stream.splithttp.scMaxEachPostBytes" :min="0"></a-input-number>
</a-form-item>
<a-form-item label="Min Upload Interval Ms">
<a-form-item label="Min Upload Interval (Ms)">
<a-input-number v-model="inbound.stream.splithttp.scMinPostsIntervalMs" :min="0"></a-input-number>
</a-form-item>
<a-form-item label="No SSE Header">
<a-switch v-model="inbound.stream.splithttp.noSSEHeader"></a-switch>
</a-form-item>
</a-form>
{{end}}

0 comments on commit fdfc29f

Please sign in to comment.