From f55b16d240e8e6acb4d5f0744aa20419976eeb40 Mon Sep 17 00:00:00 2001 From: "Shishkevich D." <135337715+shishkevichd@users.noreply.github.com> Date: Sun, 9 Mar 2025 04:24:02 +0000 Subject: [PATCH] chore: add new grpc params for outbound --- web/assets/js/model/inbound.js | 6 +---- web/assets/js/model/outbound.js | 30 ++++++++++++++++++++--- web/html/xui/form/outbound.html | 15 ++++++++++++ web/html/xui/form/stream/stream_grpc.html | 7 ++---- 4 files changed, 45 insertions(+), 13 deletions(-) diff --git a/web/assets/js/model/inbound.js b/web/assets/js/model/inbound.js index 5c3235e1..d08553d9 100644 --- a/web/assets/js/model/inbound.js +++ b/web/assets/js/model/inbound.js @@ -420,20 +420,17 @@ class WsStreamSettings extends XrayCommonClass { class GrpcStreamSettings extends XrayCommonClass { constructor( serviceName = "", - authority = "", - multiMode = false, + authority = "" ) { super(); this.serviceName = serviceName; this.authority = authority; - this.multiMode = multiMode; } static fromJson(json = {}) { return new GrpcStreamSettings( json.serviceName, json.authority, - json.multiMode ); } @@ -441,7 +438,6 @@ class GrpcStreamSettings extends XrayCommonClass { return { serviceName: this.serviceName, authority: this.authority, - multiMode: this.multiMode, } } } diff --git a/web/assets/js/model/outbound.js b/web/assets/js/model/outbound.js index 0103b1e8..38c7ce73 100644 --- a/web/assets/js/model/outbound.js +++ b/web/assets/js/model/outbound.js @@ -251,23 +251,47 @@ class GrpcStreamSettings extends CommonClass { constructor( serviceName = "", authority = "", - multiMode = false + multiMode = false, + userAgent = "", + idleTimeout = 60, + healthCheckTimeout = 20, + permitWithoutStream = false, + initialWindowsSize = 0 ) { super(); this.serviceName = serviceName; this.authority = authority; this.multiMode = multiMode; + this.user_agent = userAgent; + this.idle_timeout = idleTimeout; + this.health_check_timeout = healthCheckTimeout; + this.permit_without_stream = permitWithoutStream; + this.initial_windows_size = initialWindowsSize; } static fromJson(json = {}) { - return new GrpcStreamSettings(json.serviceName, json.authority, json.multiMode); + return new GrpcStreamSettings( + json.serviceName, + json.authority, + json.multiMode, + json.user_agent, + json.idle_timeout, + json.health_check_timeout, + json.permit_without_stream, + json.initial_windows_size + ); } toJson() { return { serviceName: this.serviceName, authority: this.authority, - multiMode: this.multiMode + multiMode: this.multiMode, + user_agent: this.user_agent, + idle_timeout: this.idle_timeout, + health_check_timeout: this.health_check_timeout, + permit_without_stream: this.permit_without_stream, + initial_windows_size: this.initial_windows_size } } } diff --git a/web/html/xui/form/outbound.html b/web/html/xui/form/outbound.html index d4e9e5f6..93b0a94f 100644 --- a/web/html/xui/form/outbound.html +++ b/web/html/xui/form/outbound.html @@ -352,6 +352,21 @@ + + + + + + + + + + + + + + + diff --git a/web/html/xui/form/stream/stream_grpc.html b/web/html/xui/form/stream/stream_grpc.html index e74a3c3f..a036080f 100644 --- a/web/html/xui/form/stream/stream_grpc.html +++ b/web/html/xui/form/stream/stream_grpc.html @@ -1,13 +1,10 @@ {{define "form/streamGRPC"}} - - - - - + + {{end}}