mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-09-10 12:16:18 +00:00
update
This commit is contained in:
parent
0af630a481
commit
0925288f16
3 changed files with 156 additions and 160 deletions
|
@ -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"] = ""
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 = '';
|
||||
|
@ -472,12 +470,12 @@ class Wireguard {
|
|||
return bytes;
|
||||
}
|
||||
|
||||
static generateKeypair(secretKey='') {
|
||||
var privateKey = secretKey.length>0 ? this.keyFromBase64(secretKey) : this.generatePrivateKey();
|
||||
static generateKeypair(secretKey = '') {
|
||||
var privateKey = secretKey.length > 0 ? this.keyFromBase64(secretKey) : this.generatePrivateKey();
|
||||
var publicKey = this.generatePublicKey(privateKey);
|
||||
return {
|
||||
publicKey: this.keyToBase64(publicKey),
|
||||
privateKey: secretKey.length>0 ? secretKey : this.keyToBase64(privateKey)
|
||||
privateKey: secretKey.length > 0 ? secretKey : this.keyToBase64(privateKey)
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue