This commit is contained in:
mhsanaei 2024-09-02 12:00:25 +02:00
parent 0af630a481
commit 0925288f16
3 changed files with 156 additions and 160 deletions

View file

@ -268,13 +268,13 @@ func (s *SubJsonService) realityData(rData map[string]interface{}) map[string]in
rltyData["spiderX"] = "/" + random.Seq(15)
shortIds, ok := rData["shortIds"].([]interface{})
if ok && len(shortIds) > 0 {
rltyData["shortId"] = shortIds[random.Num(len(shortIds))].(string)
rltyData["shortId"] = shortIds
} else {
rltyData["shortId"] = ""
}
serverNames, ok := rData["serverNames"].([]interface{})
if ok && len(serverNames) > 0 {
rltyData["serverName"] = serverNames[random.Num(len(serverNames))].(string)
rltyData["serverName"] = serverNames
} else {
rltyData["serverName"] = ""
}

View file

@ -921,13 +921,11 @@ class RealityStreamSettings extends XrayCommonClass {
this.show = show;
this.xver = xver;
this.dest = dest;
/** @type {string} */
this.serverNames = Array.isArray(serverNames) ? serverNames.join(",") : serverNames;
this.privateKey = privateKey;
this.minClient = minClient;
this.maxClient = maxClient;
this.maxTimediff = maxTimediff;
/** @type {string} */
this.shortIds = Array.isArray(shortIds) ? shortIds.join(",") : shortIds;
this.settings = settings;
}

View file

@ -99,7 +99,6 @@ class RandomUtil {
return str;
}
/** @return {string} */
static randomShortIds() {
const lengths = [2, 4, 6, 8, 10, 12, 14, 16];
for (let i = lengths.length - 1; i > 0; i--) {
@ -107,7 +106,6 @@ class RandomUtil {
[lengths[i], lengths[j]] = [lengths[j], lengths[i]];
}
/** @type {string[]} */
let shortIds = [];
for (let length of lengths) {
let shortId = '';