diff options
| author | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-05-07 19:29:06 +0300 |
|---|---|---|
| committer | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-05-07 19:29:06 +0300 |
| commit | 9bbcb74db6a935d19cf5c79c0bade33bdb253bfb (patch) | |
| tree | 195e912844094f09c09ebe458c79fa53cc56ee9e /web | |
| parent | 515e7f7fef3fe359aa0d23fa766535688c74efe3 (diff) | |
sni for xtls
Diffstat (limited to 'web')
| -rw-r--r-- | web/assets/js/model/xray.js | 6 | ||||
| -rw-r--r-- | web/html/xui/form/tls_settings.html | 3 | ||||
| -rw-r--r-- | web/service/sub.go | 6 |
3 files changed, 15 insertions, 0 deletions
diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js index 37717c9e..2d4ba84c 100644 --- a/web/assets/js/model/xray.js +++ b/web/assets/js/model/xray.js @@ -1355,6 +1355,9 @@ class Inbound extends XrayCommonClass { if (!ObjectUtil.isEmpty(this.stream.xtls.server)) { address = this.stream.xtls.server; } + if (this.stream.xtls.settings.serverName !== ''){ + params.set("sni", this.stream.xtls.settings.serverName); + } params.set("flow", this.settings.vlesses[clientIndex].flow); } @@ -1485,6 +1488,9 @@ class Inbound extends XrayCommonClass { if (!ObjectUtil.isEmpty(this.stream.xtls.server)) { address = this.stream.xtls.server; } + if (this.stream.xtls.settings.serverName !== ''){ + params.set("sni", this.stream.xtls.settings.serverName); + } params.set("flow", this.settings.trojans[clientIndex].flow); } diff --git a/web/html/xui/form/tls_settings.html b/web/html/xui/form/tls_settings.html index e6e0bece..5e02f985 100644 --- a/web/html/xui/form/tls_settings.html +++ b/web/html/xui/form/tls_settings.html @@ -100,6 +100,9 @@ <a-form-item label='{{ i18n "domainName" }}'> <a-input v-model.trim="inbound.stream.xtls.server"></a-input> </a-form-item> + <a-form-item label="SNI" placeholder="Server Name Indication"> + <a-input v-model.trim="inbound.stream.xtls.settings.serverName" style="width: 250px"></a-input> + </a-form-item> <a-form-item label="Alpn"> <a-checkbox-group v-model="inbound.stream.xtls.alpn" style="width:200px"> <a-checkbox v-for="key in ALPN_OPTION" :value="key">[[ key ]]</a-checkbox> diff --git a/web/service/sub.go b/web/service/sub.go index 3f8b7685..9a86c3eb 100644 --- a/web/service/sub.go +++ b/web/service/sub.go @@ -360,6 +360,9 @@ func (s *SubService) genVlessLink(inbound *model.Inbound, email string) string { params["allowInsecure"] = "1" } } + if sniValue, ok := searchKey(xtlsSettings, "serverName"); ok { + params["sni"], _ = sniValue.(string) + } } if streamNetwork == "tcp" && len(clients[clientIndex].Flow) > 0 { @@ -538,6 +541,9 @@ func (s *SubService) genTrojanLink(inbound *model.Inbound, email string) string params["allowInsecure"] = "1" } } + if sniValue, ok := searchKey(xtlsSettings, "serverName"); ok { + params["sni"], _ = sniValue.(string) + } } if streamNetwork == "tcp" && len(clients[clientIndex].Flow) > 0 { |
