diff options
| author | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-04-11 15:10:45 +0300 |
|---|---|---|
| committer | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-04-11 15:10:45 +0300 |
| commit | 519f2b462ee3340c959c57f5f92319dc011833e6 (patch) | |
| tree | 90d9eda1e282262cd56a388e0d98f0944da15377 /web/service | |
| parent | 11c781cce78aa4afc312eb5641ea36197e77ae7c (diff) | |
reality sub
Diffstat (limited to 'web/service')
| -rw-r--r-- | web/service/sub.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/web/service/sub.go b/web/service/sub.go index 875a5b53..d1891e14 100644 --- a/web/service/sub.go +++ b/web/service/sub.go @@ -269,6 +269,35 @@ func (s *SubService) genVlessLink(inbound *model.Inbound, email string) string { } } + if security == "reality" { + params["security"] = "reality" + realitySetting, _ := stream["realitySettings"].(map[string]interface{}) + realitySettings, _ := searchKey(realitySetting, "settings") + if realitySetting != nil { + if sniValue, ok := searchKey(realitySettings, "serverName"); ok { + params["sni"], _ = sniValue.(string) + } + if pbkValue, ok := searchKey(realitySettings, "publicKey"); ok { + params["pbk"], _ = pbkValue.(string) + } + if sidValue, ok := searchKey(realitySettings, "shortIds"); ok { + params["sid"], _ = sidValue.(string) + } + if fpValue, ok := searchKey(realitySettings, "fingerprint"); ok { + params["fp"], _ = fpValue.(string) + } + } + + if streamNetwork == "tcp" && len(clients[clientIndex].Flow) > 0 { + params["flow"] = clients[clientIndex].Flow + } + + serverName, _ := realitySetting["serverName"].(string) + if serverName != "" { + address = serverName + } + } + if security == "xtls" { params["security"] = "xtls" xtlsSetting, _ := stream["xtlsSettings"].(map[string]interface{}) |
