瀏覽代碼

[feature] add sniffing DestOverride options #298

Co-Authored-By: Alireza Ahmadi <[email protected]>
MHSanaei 1 年之前
父節點
當前提交
c3ed8051f3
共有 4 個文件被更改,包括 17 次插入4 次删除
  1. 9 2
      web/assets/js/model/xray.js
  2. 2 1
      web/controller/base.go
  3. 5 0
      web/html/xui/form/sniffing.html
  4. 1 1
      web/html/xui/form/tls_settings.html

+ 9 - 2
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 {
 

+ 2 - 1
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 {

+ 5 - 0
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}}

+ 1 - 1
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">