mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-10-25 23:35:00 +03:00
feat(hosts): give a host a pool of SNIs, random per config or shared (#6923)
Rotating SNIs meant one host entry per domain. A host now takes a pool of SNIs: with more than one, every generated config gets a random entry, or, with the shared switch on, the whole host group uses one pick per subscription fetch. Raw, JSON and Clash output, the panel's link preview and node adoption all carry the pool. sni stays the pool's first entry, so a rolled-back binary and API callers that only know the single field keep working; an sni outside the pool becomes its primary. A host with one SNI renders exactly as before.
This commit is contained in:
@@ -428,6 +428,8 @@ type HostGroup struct {
|
||||
Port int `json:"port" validate:"gte=0,lte=65535"`
|
||||
Security string `json:"security" validate:"omitempty,oneof=same tls none reality"`
|
||||
Sni string `json:"sni"`
|
||||
Snis []string `json:"snis"`
|
||||
SniSharedRandom bool `json:"sniSharedRandom"`
|
||||
HostHeader string `json:"hostHeader"`
|
||||
Path string `json:"path"`
|
||||
Alpn []string `json:"alpn"`
|
||||
|
||||
Reference in New Issue
Block a user