Skip to content

Commit

Permalink
[feature] add sniffing DestOverride options #298
Browse files Browse the repository at this point in the history
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
  • Loading branch information
MHSanaei and alireza0 committed Apr 29, 2023
1 parent d2cdc51 commit c3ed805
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
11 changes: 9 additions & 2 deletions web/assets/js/model/xray.js
Expand Up @@ -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);
Expand All @@ -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 {

Expand Down
3 changes: 2 additions & 1 deletion 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 {
Expand Down
5 changes: 5 additions & 0 deletions web/html/xui/form/sniffing.html
Expand Up @@ -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}}
2 changes: 1 addition & 1 deletion web/html/xui/form/tls_settings.html
Expand Up @@ -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">
Expand Down

0 comments on commit c3ed805

Please sign in to comment.