mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-10-24 14:55:02 +03:00
feat(sub): generate random IPs from CIDR host addresses (#6784)
Operators who front a server with an IP range (a CDN or anycast prefix) had to list each address as its own host. A host address may now be a CIDR, and every subscription fetch expands it into up to randomCount (1–100, default 1) unique random host IPs from the range, IPv4 and IPv6 alike, skipping the network and broadcast addresses. The panel's own previews, QR codes and tunnel config exports (WireGuard, AmneziaWG, TUIC, MTProto) expand it the same way, and the externalProxy importer writes the model's default count so the re-sync still recognises untouched imported hosts.
This commit is contained in:
@@ -447,4 +447,5 @@ type HostGroup struct {
|
||||
MihomoIpVersion string `json:"mihomoIpVersion" validate:"omitempty,oneof=dual ipv4 ipv6 ipv4-prefer ipv6-prefer"`
|
||||
MihomoX25519 bool `json:"mihomoX25519"`
|
||||
ShuffleHost bool `json:"shuffleHost"`
|
||||
RandomCount int `json:"randomCount" validate:"omitempty,min=1,max=100"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user