Skip to content

Commit 0df85cc

Browse files
committed
XHTTP: server & client
Remove scMinPostsIntervalMs, xmux, noGRPCHeader from the server side and add them to the client side. Before you could have them on sub json but I decided to remove them.
1 parent f0f4f08 commit 0df85cc

File tree

4 files changed

+52
-52
lines changed

4 files changed

+52
-52
lines changed

web/assets/js/model/inbound.js

-26
Original file line numberDiff line numberDiff line change
@@ -496,32 +496,19 @@ class xHTTPStreamSettings extends XrayCommonClass {
496496
headers = [],
497497
scMaxBufferedPosts = 30,
498498
scMaxEachPostBytes = "1000000",
499-
scMinPostsIntervalMs = "30",
500499
noSSEHeader = false,
501500
xPaddingBytes = "100-1000",
502-
xmux = {
503-
maxConcurrency: "16-32",
504-
maxConnections: 0,
505-
cMaxReuseTimes: "64-128",
506-
cMaxLifetimeMs: 0,
507-
hMaxRequestTimes: "800-900",
508-
hKeepAlivePeriod: 0,
509-
},
510501
mode = MODE_OPTION.AUTO,
511-
noGRPCHeader = false
512502
) {
513503
super();
514504
this.path = path;
515505
this.host = host;
516506
this.headers = headers;
517507
this.scMaxBufferedPosts = scMaxBufferedPosts;
518508
this.scMaxEachPostBytes = scMaxEachPostBytes;
519-
this.scMinPostsIntervalMs = scMinPostsIntervalMs;
520509
this.noSSEHeader = noSSEHeader;
521510
this.xPaddingBytes = xPaddingBytes;
522-
this.xmux = xmux;
523511
this.mode = mode;
524-
this.noGRPCHeader = noGRPCHeader;
525512
}
526513

527514
addHeader(name, value) {
@@ -539,12 +526,9 @@ class xHTTPStreamSettings extends XrayCommonClass {
539526
XrayCommonClass.toHeaders(json.headers),
540527
json.scMaxBufferedPosts,
541528
json.scMaxEachPostBytes,
542-
json.scMinPostsIntervalMs,
543529
json.noSSEHeader,
544530
json.xPaddingBytes,
545-
json.xmux,
546531
json.mode,
547-
json.noGRPCHeader,
548532
);
549533
}
550534

@@ -555,19 +539,9 @@ class xHTTPStreamSettings extends XrayCommonClass {
555539
headers: XrayCommonClass.toV2Headers(this.headers, false),
556540
scMaxBufferedPosts: this.scMaxBufferedPosts,
557541
scMaxEachPostBytes: this.scMaxEachPostBytes,
558-
scMinPostsIntervalMs: this.scMinPostsIntervalMs,
559542
noSSEHeader: this.noSSEHeader,
560543
xPaddingBytes: this.xPaddingBytes,
561-
xmux: {
562-
maxConcurrency: this.xmux.maxConcurrency,
563-
maxConnections: this.xmux.maxConnections,
564-
cMaxReuseTimes: this.xmux.cMaxReuseTimes,
565-
cMaxLifetimeMs: this.xmux.cMaxLifetimeMs,
566-
hMaxRequestTimes: this.xmux.hMaxRequestTimes,
567-
hKeepAlivePeriod: this.xmux.hKeepAlivePeriod,
568-
},
569544
mode: this.mode,
570-
noGRPCHeader: this.noGRPCHeader,
571545
};
572546
}
573547
}

web/assets/js/model/outbound.js

+26
Original file line numberDiff line numberDiff line change
@@ -287,18 +287,34 @@ class xHTTPStreamSettings extends CommonClass {
287287
path = '/',
288288
host = '',
289289
mode = '',
290+
noGRPCHeader = false,
291+
scMinPostsIntervalMs = "30",
292+
xmux = {
293+
maxConcurrency: "16-32",
294+
maxConnections: 0,
295+
cMaxReuseTimes: "64-128",
296+
cMaxLifetimeMs: 0,
297+
hMaxRequestTimes: "800-900",
298+
hKeepAlivePeriod: 0,
299+
},
290300
) {
291301
super();
292302
this.path = path;
293303
this.host = host;
294304
this.mode = mode;
305+
this.noGRPCHeader = noGRPCHeader;
306+
this.scMinPostsIntervalMs = scMinPostsIntervalMs;
307+
this.xmux = xmux;
295308
}
296309

297310
static fromJson(json = {}) {
298311
return new xHTTPStreamSettings(
299312
json.path,
300313
json.host,
301314
json.mode,
315+
json.noGRPCHeader,
316+
json.scMinPostsIntervalMs,
317+
json.xmux
302318
);
303319
}
304320

@@ -307,6 +323,16 @@ class xHTTPStreamSettings extends CommonClass {
307323
path: this.path,
308324
host: this.host,
309325
mode: this.mode,
326+
noGRPCHeader: this.noGRPCHeader,
327+
scMinPostsIntervalMs: this.scMinPostsIntervalMs,
328+
xmux: {
329+
maxConcurrency: this.xmux.maxConcurrency,
330+
maxConnections: this.xmux.maxConnections,
331+
cMaxReuseTimes: this.xmux.cMaxReuseTimes,
332+
cMaxLifetimeMs: this.xmux.cMaxLifetimeMs,
333+
hMaxRequestTimes: this.xmux.hMaxRequestTimes,
334+
hKeepAlivePeriod: this.xmux.hKeepAlivePeriod,
335+
},
310336
};
311337
}
312338
}

web/html/xui/form/outbound.html

+24
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,30 @@
377377
<a-select-option v-for="key in MODE_OPTION" :value="key">[[ key ]]</a-select-option>
378378
</a-select>
379379
</a-form-item>
380+
<a-form-item label="No gRPC Header" v-if="outbound.stream.xhttp.mode === 'stream-up' || outbound.stream.xhttp.mode === 'stream-one'">
381+
<a-switch v-model="outbound.stream.xhttp.noGRPCHeader"></a-switch>
382+
</a-form-item>
383+
<a-form-item label="Min Upload Interval (Ms)" v-if="outbound.stream.xhttp.mode === 'packet-up'">
384+
<a-input v-model.trim="outbound.stream.xhttp.scMinPostsIntervalMs"></a-input>
385+
</a-form-item>
386+
<a-form-item label="Max Concurrency" v-if="!outbound.stream.xhttp.xmux.maxConnections">
387+
<a-input v-model="outbound.stream.xhttp.xmux.maxConcurrency"></a-input>
388+
</a-form-item>
389+
<a-form-item label="Max Connections" v-if="!outbound.stream.xhttp.xmux.maxConcurrency">
390+
<a-input v-model="outbound.stream.xhttp.xmux.maxConnections"></a-input>
391+
</a-form-item>
392+
<a-form-item label="Max Reuse Times">
393+
<a-input v-model="outbound.stream.xhttp.xmux.cMaxReuseTimes"></a-input>
394+
</a-form-item>
395+
<a-form-item label="Max Lifetime (ms)">
396+
<a-input v-model="outbound.stream.xhttp.xmux.cMaxLifetimeMs"></a-input>
397+
</a-form-item>
398+
<a-form-item label="Max Request Times">
399+
<a-input v-model="outbound.stream.xhttp.xmux.hMaxRequestTimes"></a-input>
400+
</a-form-item>
401+
<a-form-item label='Keep Alive Period'>
402+
<a-input v-model.number="outbound.stream.xhttp.xmux.hKeepAlivePeriod"></a-input>
403+
</a-form-item>
380404
</template>
381405
</template>
382406

web/html/xui/form/stream/stream_xhttp.html

+2-26
Original file line numberDiff line numberDiff line change
@@ -27,41 +27,17 @@
2727
<a-select-option v-for="key in MODE_OPTION" :value="key">[[ key ]]</a-select-option>
2828
</a-select>
2929
</a-form-item>
30-
<a-form-item label="Max Buffered Upload">
30+
<a-form-item label="Max Buffered Upload" v-if="inbound.stream.xhttp.mode === 'packet-up'">
3131
<a-input v-model.trim="inbound.stream.xhttp.scMaxBufferedPosts"></a-input>
3232
</a-form-item>
33-
<a-form-item label="Max Upload Size (Byte)">
33+
<a-form-item label="Max Upload Size (Byte)" v-if="inbound.stream.xhttp.mode === 'packet-up'">
3434
<a-input v-model.trim="inbound.stream.xhttp.scMaxEachPostBytes"></a-input>
3535
</a-form-item>
36-
<a-form-item label="Min Upload Interval (Ms)">
37-
<a-input v-model.trim="inbound.stream.xhttp.scMinPostsIntervalMs"></a-input>
38-
</a-form-item>
3936
<a-form-item label="Padding Bytes">
4037
<a-input v-model.trim="inbound.stream.xhttp.xPaddingBytes"></a-input>
4138
</a-form-item>
4239
<a-form-item label="No SSE Header">
4340
<a-switch v-model="inbound.stream.xhttp.noSSEHeader"></a-switch>
4441
</a-form-item>
45-
<a-form-item label="Max Concurrency" v-if="!inbound.stream.xhttp.xmux.maxConnections">
46-
<a-input v-model="inbound.stream.xhttp.xmux.maxConcurrency"></a-input>
47-
</a-form-item>
48-
<a-form-item label="Max Connections" v-if="!inbound.stream.xhttp.xmux.maxConcurrency">
49-
<a-input v-model="inbound.stream.xhttp.xmux.maxConnections"></a-input>
50-
</a-form-item>
51-
<a-form-item label="Max Reuse Times">
52-
<a-input v-model="inbound.stream.xhttp.xmux.cMaxReuseTimes"></a-input>
53-
</a-form-item>
54-
<a-form-item label="Max Lifetime (ms)">
55-
<a-input v-model="inbound.stream.xhttp.xmux.cMaxLifetimeMs"></a-input>
56-
</a-form-item>
57-
<a-form-item label="Max Request Times">
58-
<a-input v-model="inbound.stream.xhttp.xmux.hMaxRequestTimes"></a-input>
59-
</a-form-item>
60-
<a-form-item label='Keep Alive Period'>
61-
<a-input v-model.number="inbound.stream.xhttp.xmux.hKeepAlivePeriod"></a-input>
62-
</a-form-item>
63-
<a-form-item label="No gRPC Header">
64-
<a-switch v-model="inbound.stream.xhttp.noGRPCHeader"></a-switch>
65-
</a-form-item>
6642
</a-form>
6743
{{end}}

0 commit comments

Comments
 (0)