feat: Add random Reality Target/SNI selection from 52 popular services (#3577)

* feat: Add random Reality Target/SNI selection from 52 popular services

- Created reality_targets.js with list of 52 popular services
- Updated RealityStreamSettings to use random targets by default
- Added UI randomize buttons with sync icon in Reality settings form
- Implemented randomizeRealityTarget() method in inbound modal
- Replaces hardcoded google.com with diverse global services

* fix

---------

Co-authored-by: mhsanaei <ho3ein.sanaei@gmail.com>
This commit is contained in:
Denis Gorelov
2025-11-01 15:07:05 +03:00
committed by GitHub
parent 020cd63e22
commit 313b51f96f
5 changed files with 122 additions and 4 deletions

View File

@@ -729,8 +729,8 @@ class RealityStreamSettings extends XrayCommonClass {
constructor(
show = false,
xver = 0,
target = 'google.com:443',
serverNames = 'google.com,www.google.com',
target = '',
serverNames = '',
privateKey = '',
minClientVer = '',
maxClientVer = '',
@@ -740,6 +740,14 @@ class RealityStreamSettings extends XrayCommonClass {
settings = new RealityStreamSettings.Settings()
) {
super();
// If target/serverNames are not provided, use random values
if (!target && !serverNames) {
const randomTarget = typeof getRandomRealityTarget !== 'undefined'
? getRandomRealityTarget()
: { target: 'google.com:443', sni: 'google.com,www.google.com' };
target = randomTarget.target;
serverNames = randomTarget.sni;
}
this.show = show;
this.xver = xver;
this.target = target;