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 @@ + + + [[ key ]] 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 {