diff options
| author | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-04-29 18:17:44 +0300 |
|---|---|---|
| committer | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-04-29 18:17:44 +0300 |
| commit | c3ed8051f39339caccd08fecf817dbb5b08098d3 (patch) | |
| tree | 6d7c9efa60aae32972f6cb9c497a05d3ee03a979 | |
| parent | d2cdc51c54315bed270599793cda79131253dc45 (diff) | |
[feature] add sniffing DestOverride options #298
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
| -rw-r--r-- | web/assets/js/model/xray.js | 11 | ||||
| -rw-r--r-- | web/controller/base.go | 3 | ||||
| -rw-r--r-- | web/html/xui/form/sniffing.html | 5 | ||||
| -rw-r--r-- | web/html/xui/form/tls_settings.html | 2 |
4 files changed, 17 insertions, 4 deletions
diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js index 88ded883..c8b02641 100644 --- a/web/assets/js/model/xray.js +++ b/web/assets/js/model/xray.js @@ -79,9 +79,15 @@ const UTLS_FINGERPRINT = { }; const ALPN_OPTION = { - H3: "h3", - H2: "h2", HTTP1: "http/1.1", + H2: "h2", + H3: "h3", +}; + +const SNIFFING_OPTION = { + HTTP: "http", + TLS: "tls", + QUIC: "quic", }; Object.freeze(Protocols); @@ -92,6 +98,7 @@ Object.freeze(TLS_FLOW_CONTROL); Object.freeze(TLS_VERSION_OPTION); Object.freeze(TLS_CIPHER_OPTION); Object.freeze(ALPN_OPTION); +Object.freeze(SNIFFING_OPTION); class XrayCommonClass { diff --git a/web/controller/base.go b/web/controller/base.go index a9659bd2..98e1831c 100644 --- a/web/controller/base.go +++ b/web/controller/base.go @@ -1,9 +1,10 @@ package controller import ( - "github.com/gin-gonic/gin" "net/http" "x-ui/web/session" + + "github.com/gin-gonic/gin" ) type BaseController struct { diff --git a/web/html/xui/form/sniffing.html b/web/html/xui/form/sniffing.html index 6bfab7c1..4d184028 100644 --- a/web/html/xui/form/sniffing.html +++ b/web/html/xui/form/sniffing.html @@ -12,5 +12,10 @@ </span> <a-switch v-model="inbound.sniffing.enabled"></a-switch> </a-form-item> + <a-form-item> + <a-checkbox-group v-model="inbound.sniffing.destOverride" v-if="inbound.sniffing.enabled"> + <a-checkbox v-for="key,value in SNIFFING_OPTION" :value="key">[[ value ]]</a-checkbox> + </a-checkbox-group> + </a-form-item> </a-form> {{end}}
\ No newline at end of file diff --git a/web/html/xui/form/tls_settings.html b/web/html/xui/form/tls_settings.html index dcef3990..9cd03972 100644 --- a/web/html/xui/form/tls_settings.html +++ b/web/html/xui/form/tls_settings.html @@ -63,7 +63,7 @@ </a-form-item> <a-form-item label="Alpn"> <a-checkbox-group v-model="inbound.stream.tls.alpn" style="width:200px"> - <a-checkbox v-for="key in ALPN_OPTION" :value="key">[[ key ]]</a-checkbox> + <a-checkbox v-for="key,value in ALPN_OPTION" :value="key">[[ value ]]</a-checkbox> </a-checkbox-group> </a-form-item> <a-form-item label="Allow insecure"> |
