diff options
| author | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-06-09 18:23:57 +0300 |
|---|---|---|
| committer | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-06-09 18:23:57 +0300 |
| commit | dea61b839c6920a85a10377aef04ae2325fd65d5 (patch) | |
| tree | 386afbfb01c24b51f2b8a5bb063cd91607669f3a | |
| parent | 90633367788163b295fdf548de3533a160bf3128 (diff) | |
new - acceptProxyProtocol for H2 and gRPC #581
| -rw-r--r-- | web/assets/js/model/xray.js | 22 | ||||
| -rw-r--r-- | web/html/xui/form/stream/stream_grpc.html | 4 | ||||
| -rw-r--r-- | web/html/xui/form/stream/stream_http.html | 4 | ||||
| -rw-r--r-- | web/html/xui/form/stream/stream_ws.html | 3 |
4 files changed, 26 insertions, 7 deletions
diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js index 255577df..0e737bb0 100644 --- a/web/assets/js/model/xray.js +++ b/web/assets/js/model/xray.js @@ -378,10 +378,15 @@ class WsStreamSettings extends XrayCommonClass { } class HttpStreamSettings extends XrayCommonClass { - constructor(path='/', host=['']) { + constructor( + path='/', + host=[''], + sockopt={acceptProxyProtocol: false} + ) { super(); this.path = path; this.host = host.length === 0 ? [''] : host; + this.sockopt = sockopt; } addHost(host) { @@ -393,7 +398,7 @@ class HttpStreamSettings extends XrayCommonClass { } static fromJson(json={}) { - return new HttpStreamSettings(json.path, json.host); + return new HttpStreamSettings(json.path, json.host, json.sockopt); } toJson() { @@ -406,10 +411,12 @@ class HttpStreamSettings extends XrayCommonClass { return { path: this.path, host: host, + sockopt: this.sockopt, } } } + class QuicStreamSettings extends XrayCommonClass { constructor(security=VmessMethods.NONE, key='', type='none') { @@ -441,28 +448,33 @@ class QuicStreamSettings extends XrayCommonClass { class GrpcStreamSettings extends XrayCommonClass { constructor( serviceName="", - multiMode=false + multiMode=false, + sockopt={acceptProxyProtocol: false} ) { super(); this.serviceName = serviceName; this.multiMode = multiMode; + this.sockopt = sockopt; } static fromJson(json={}) { return new GrpcStreamSettings( json.serviceName, - json.multiMode + json.multiMode, + json.sockopt ); } toJson() { return { serviceName: this.serviceName, - multiMode: this.multiMode + multiMode: this.multiMode, + sockopt: this.sockopt } } } + class TlsStreamSettings extends XrayCommonClass { constructor(serverName='', minVersion = TLS_VERSION_OPTION.TLS12, diff --git a/web/html/xui/form/stream/stream_grpc.html b/web/html/xui/form/stream/stream_grpc.html index 21c95f99..f34a3457 100644 --- a/web/html/xui/form/stream/stream_grpc.html +++ b/web/html/xui/form/stream/stream_grpc.html @@ -1,5 +1,9 @@ {{define "form/streamGRPC"}} <a-form layout="inline"> + <a-form-item label="AcceptProxyProtocol"> + <a-switch v-model="inbound.stream.grpc.sockopt.acceptProxyProtocol"></a-switch> + </a-form-item> + <br> <a-form-item label="ServiceName"> <a-input v-model.trim="inbound.stream.grpc.serviceName"></a-input> </a-form-item> diff --git a/web/html/xui/form/stream/stream_http.html b/web/html/xui/form/stream/stream_http.html index 57574ce5..17bd3759 100644 --- a/web/html/xui/form/stream/stream_http.html +++ b/web/html/xui/form/stream/stream_http.html @@ -1,5 +1,9 @@ {{define "form/streamHTTP"}} <a-form layout="inline"> + <a-form-item label="AcceptProxyProtocol"> + <a-switch v-model="inbound.stream.http.sockopt.acceptProxyProtocol"></a-switch> + </a-form-item> + <br> <a-form-item label='{{ i18n "path" }}'> <a-input v-model.trim="inbound.stream.http.path"></a-input> </a-form-item> diff --git a/web/html/xui/form/stream/stream_ws.html b/web/html/xui/form/stream/stream_ws.html index ec9d3755..25d1299c 100644 --- a/web/html/xui/form/stream/stream_ws.html +++ b/web/html/xui/form/stream/stream_ws.html @@ -3,8 +3,7 @@ <a-form-item label="AcceptProxyProtocol"> <a-switch v-model="inbound.stream.ws.acceptProxyProtocol"></a-switch> </a-form-item> -</a-form> -<a-form layout="inline"> + <br> <a-form-item label='{{ i18n "path" }}'> <a-input v-model.trim="inbound.stream.ws.path"></a-input> </a-form-item> |
