mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-05-18 12:05:53 +00:00
parent
4e1b597914
commit
b47f794ed0
3 changed files with 4 additions and 9 deletions
|
|
@ -19,9 +19,6 @@ export default [
|
||||||
globals: {
|
globals: {
|
||||||
...globals.browser,
|
...globals.browser,
|
||||||
...globals.node,
|
...globals.node,
|
||||||
// Legacy script tags inject a couple of helpers on window before
|
|
||||||
// the SPA boots; declared here so no-undef stops flagging them.
|
|
||||||
getRandomRealityTarget: 'readonly',
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { ObjectUtil, RandomUtil, Base64, NumberFormatter, SizeFormatter, Wireguard } from '@/utils';
|
import { ObjectUtil, RandomUtil, Base64, NumberFormatter, SizeFormatter, Wireguard } from '@/utils';
|
||||||
|
import { getRandomRealityTarget } from '@/models/reality-targets';
|
||||||
|
|
||||||
export const Protocols = {
|
export const Protocols = {
|
||||||
VMESS: 'vmess',
|
VMESS: 'vmess',
|
||||||
|
|
@ -897,9 +898,7 @@ export class RealityStreamSettings extends XrayCommonClass {
|
||||||
super();
|
super();
|
||||||
// If target/serverNames are not provided, use random values
|
// If target/serverNames are not provided, use random values
|
||||||
if (!target && !serverNames) {
|
if (!target && !serverNames) {
|
||||||
const randomTarget = typeof getRandomRealityTarget !== 'undefined'
|
const randomTarget = getRandomRealityTarget();
|
||||||
? getRandomRealityTarget()
|
|
||||||
: { target: 'www.amazon.com:443', sni: 'www.amazon.com,amazon.com' };
|
|
||||||
target = randomTarget.target;
|
target = randomTarget.target;
|
||||||
serverNames = randomTarget.sni;
|
serverNames = randomTarget.sni;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import {
|
||||||
SizeFormatter,
|
SizeFormatter,
|
||||||
Wireguard,
|
Wireguard,
|
||||||
} from '@/utils';
|
} from '@/utils';
|
||||||
|
import { getRandomRealityTarget } from '@/models/reality-targets';
|
||||||
import {
|
import {
|
||||||
Inbound,
|
Inbound,
|
||||||
Protocols,
|
Protocols,
|
||||||
|
|
@ -339,11 +340,9 @@ function clearMldsa65() {
|
||||||
inbound.value.stream.reality.settings.mldsa65Verify = '';
|
inbound.value.stream.reality.settings.mldsa65Verify = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reality target/SNI randomizer — only available if the helper is loaded
|
|
||||||
function randomizeRealityTarget() {
|
function randomizeRealityTarget() {
|
||||||
if (!inbound.value?.stream?.reality) return;
|
if (!inbound.value?.stream?.reality) return;
|
||||||
if (typeof window.getRandomRealityTarget !== 'function') return;
|
const t = getRandomRealityTarget();
|
||||||
const t = window.getRandomRealityTarget();
|
|
||||||
inbound.value.stream.reality.target = t.target;
|
inbound.value.stream.reality.target = t.target;
|
||||||
inbound.value.stream.reality.serverNames = t.sni;
|
inbound.value.stream.reality.serverNames = t.sni;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue