diff options
| -rw-r--r-- | sub/subService.go | 21 | ||||
| -rw-r--r-- | web/html/xui/form/outbound.html | 4 | ||||
| -rw-r--r-- | web/html/xui/form/stream/stream_httpupgrade.html | 2 | ||||
| -rw-r--r-- | web/html/xui/form/stream/stream_settings.html | 6 |
4 files changed, 13 insertions, 20 deletions
diff --git a/sub/subService.go b/sub/subService.go index 97473159..0ed1d454 100644 --- a/sub/subService.go +++ b/sub/subService.go @@ -11,6 +11,7 @@ import ( "x-ui/database/model" "x-ui/logger" "x-ui/util/common" + "x-ui/util/random" "x-ui/web/service" "x-ui/xray" @@ -402,25 +403,21 @@ func (s *SubService) genVlessLink(inbound *model.Inbound, email string) string { if realitySetting != nil { if sniValue, ok := searchKey(realitySetting, "serverNames"); ok { sNames, _ := sniValue.([]interface{}) - params["sni"], _ = sNames[0].(string) + params["sni"] = sNames[random.Num(len(sNames))].(string) } if pbkValue, ok := searchKey(realitySettings, "publicKey"); ok { params["pbk"], _ = pbkValue.(string) } if sidValue, ok := searchKey(realitySetting, "shortIds"); ok { shortIds, _ := sidValue.([]interface{}) - params["sid"], _ = shortIds[0].(string) + params["sid"] = shortIds[random.Num(len(shortIds))].(string) } if fpValue, ok := searchKey(realitySettings, "fingerprint"); ok { if fp, ok := fpValue.(string); ok && len(fp) > 0 { params["fp"] = fp } } - if spxValue, ok := searchKey(realitySettings, "spiderX"); ok { - if spx, ok := spxValue.(string); ok && len(spx) > 0 { - params["spx"] = spx - } - } + params["spx"] = "/" + random.Seq(15) } if streamNetwork == "tcp" && len(clients[clientIndex].Flow) > 0 { @@ -619,25 +616,21 @@ func (s *SubService) genTrojanLink(inbound *model.Inbound, email string) string if realitySetting != nil { if sniValue, ok := searchKey(realitySetting, "serverNames"); ok { sNames, _ := sniValue.([]interface{}) - params["sni"], _ = sNames[0].(string) + params["sni"] = sNames[random.Num(len(sNames))].(string) } if pbkValue, ok := searchKey(realitySettings, "publicKey"); ok { params["pbk"], _ = pbkValue.(string) } if sidValue, ok := searchKey(realitySetting, "shortIds"); ok { shortIds, _ := sidValue.([]interface{}) - params["sid"], _ = shortIds[0].(string) + params["sid"] = shortIds[random.Num(len(shortIds))].(string) } if fpValue, ok := searchKey(realitySettings, "fingerprint"); ok { if fp, ok := fpValue.(string); ok && len(fp) > 0 { params["fp"] = fp } } - if spxValue, ok := searchKey(realitySettings, "spiderX"); ok { - if spx, ok := spxValue.(string); ok && len(spx) > 0 { - params["spx"] = spx - } - } + params["spx"] = "/" + random.Seq(15) } if streamNetwork == "tcp" && len(clients[clientIndex].Flow) > 0 { diff --git a/web/html/xui/form/outbound.html b/web/html/xui/form/outbound.html index 2f2a5215..e3d6a560 100644 --- a/web/html/xui/form/outbound.html +++ b/web/html/xui/form/outbound.html @@ -219,11 +219,11 @@ :dropdown-class-name="themeSwitcher.currentTheme"> <a-select-option value="tcp">TCP</a-select-option> <a-select-option value="kcp">mKCP</a-select-option> - <a-select-option value="ws">WS</a-select-option> + <a-select-option value="ws">WebSocket</a-select-option> <a-select-option value="http">H2</a-select-option> <a-select-option value="quic">QUIC</a-select-option> <a-select-option value="grpc">gRPC</a-select-option> - <a-select-option value="httpupgrade">HttpUpgrade</a-select-option> + <a-select-option value="httpupgrade">HTTPUpgrade</a-select-option> </a-select> </a-form-item> <template v-if="outbound.stream.network === 'tcp'"> diff --git a/web/html/xui/form/stream/stream_httpupgrade.html b/web/html/xui/form/stream/stream_httpupgrade.html index 73f10b07..15c02aeb 100644 --- a/web/html/xui/form/stream/stream_httpupgrade.html +++ b/web/html/xui/form/stream/stream_httpupgrade.html @@ -1,4 +1,4 @@ -{{define "form/streamHTTPUPGRADE"}} +{{define "form/streamHTTPUpgrade"}} <a-form :colon="false" :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }"> <a-form-item label="PROXY Protocol"> <a-switch v-model="inbound.stream.httpupgrade.acceptProxyProtocol"></a-switch> diff --git a/web/html/xui/form/stream/stream_settings.html b/web/html/xui/form/stream/stream_settings.html index a3cb0362..0d1eaa23 100644 --- a/web/html/xui/form/stream/stream_settings.html +++ b/web/html/xui/form/stream/stream_settings.html @@ -6,11 +6,11 @@ :dropdown-class-name="themeSwitcher.currentTheme"> <a-select-option value="tcp">TCP</a-select-option> <a-select-option value="kcp">mKCP</a-select-option> - <a-select-option value="ws">WS</a-select-option> + <a-select-option value="ws">WebSocket</a-select-option> <a-select-option value="http">H2</a-select-option> <a-select-option value="quic">QUIC</a-select-option> <a-select-option value="grpc">gRPC</a-select-option> - <a-select-option value="httpupgrade">HttpUpgrade</a-select-option> + <a-select-option value="httpupgrade">HTTPUpgrade</a-select-option> </a-select> </a-form-item> </a-form> @@ -47,7 +47,7 @@ <!-- httpupgrade --> <template v-if="inbound.stream.network === 'httpupgrade'"> - {{template "form/streamHTTPUPGRADE"}} + {{template "form/streamHTTPUpgrade"}} </template> <!-- sockopt --> |
