mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-04-16 04:25:46 +00:00
feat(sub): add sni override field to externalProxy
Allow externalProxy entries to specify a "sni" field that overrides the randomly selected serverName in subscription links. This is needed when an inbound has extra serverNames for fallback routing (e.g., MTProto) that should not appear in client subscription links.
This commit is contained in:
parent
ba8194141b
commit
0bc001b80c
1 changed files with 24 additions and 0 deletions
|
|
@ -492,6 +492,14 @@ func (s *SubService) genVlessLink(inbound *model.Inbound, email string) string {
|
|||
} else {
|
||||
params["security"] = security
|
||||
}
|
||||
|
||||
// Allow externalProxy to override SNI (useful when the
|
||||
// inbound has extra serverNames for fallback routing that
|
||||
// should not appear in subscription links).
|
||||
if sni, ok := ep["sni"].(string); ok && len(sni) > 0 {
|
||||
params["sni"] = sni
|
||||
}
|
||||
|
||||
url, _ := url.Parse(link)
|
||||
q := url.Query()
|
||||
|
||||
|
|
@ -687,6 +695,14 @@ func (s *SubService) genTrojanLink(inbound *model.Inbound, email string) string
|
|||
} else {
|
||||
params["security"] = security
|
||||
}
|
||||
|
||||
// Allow externalProxy to override SNI (useful when the
|
||||
// inbound has extra serverNames for fallback routing that
|
||||
// should not appear in subscription links).
|
||||
if sni, ok := ep["sni"].(string); ok && len(sni) > 0 {
|
||||
params["sni"] = sni
|
||||
}
|
||||
|
||||
url, _ := url.Parse(link)
|
||||
q := url.Query()
|
||||
|
||||
|
|
@ -854,6 +870,14 @@ func (s *SubService) genShadowsocksLink(inbound *model.Inbound, email string) st
|
|||
} else {
|
||||
params["security"] = security
|
||||
}
|
||||
|
||||
// Allow externalProxy to override SNI (useful when the
|
||||
// inbound has extra serverNames for fallback routing that
|
||||
// should not appear in subscription links).
|
||||
if sni, ok := ep["sni"].(string); ok && len(sni) > 0 {
|
||||
params["sni"] = sni
|
||||
}
|
||||
|
||||
url, _ := url.Parse(link)
|
||||
q := url.Query()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue