update noise to noises

+ type
This commit is contained in:
mhsanaei
2024-09-17 09:33:44 +02:00
parent 77edea5419
commit 6b0c9a5fad
18 changed files with 104 additions and 70 deletions
+13 -7
View File
@@ -854,14 +854,14 @@ Outbound.FreedomSettings = class extends CommonClass {
timeout = 10,
redirect = '',
fragment = {},
noise = {}
noises = {}
) {
super();
this.domainStrategy = domainStrategy;
this.timeout = timeout;
this.redirect = redirect;
this.fragment = fragment;
this.noise = noise;
this.noises = noises;
}
static fromJson(json = {}) {
@@ -870,7 +870,7 @@ Outbound.FreedomSettings = class extends CommonClass {
json.timeout,
json.redirect,
json.fragment ? Outbound.FreedomSettings.Fragment.fromJson(json.fragment) : undefined,
json.noise ? Outbound.FreedomSettings.Noise.fromJson(json.noise) : undefined,
json.noises ? Outbound.FreedomSettings.Noises.fromJson(json.noises) : undefined,
);
}
@@ -880,7 +880,7 @@ Outbound.FreedomSettings = class extends CommonClass {
timeout: this.timeout,
redirect: this.redirect,
fragment: Object.keys(this.fragment).length === 0 ? undefined : this.fragment,
noise: Object.keys(this.noise).length === 0 ? undefined : this.noise,
noises: Object.keys(this.noises).length === 0 ? undefined : this.noises,
};
}
};
@@ -900,15 +900,21 @@ Outbound.FreedomSettings.Fragment = class extends CommonClass {
);
}
};
Outbound.FreedomSettings.Noise = class extends CommonClass {
constructor(packet = 'rand:100-200', delay = '10-20') {
Outbound.FreedomSettings.Noises = class extends CommonClass {
constructor(
type = 'rand',
packet = '10-20',
delay = '10-16'
) {
super();
this.type = type;
this.packet = packet;
this.delay = delay;
}
static fromJson(json = {}) {
return new Outbound.FreedomSettings.Noise(
return new Outbound.FreedomSettings.Noises(
json.type,
json.packet,
json.delay,
);
+1 -1
View File
@@ -38,7 +38,7 @@ class AllSetting {
this.subURI = "";
this.subJsonURI = "";
this.subJsonFragment = "";
this.subJsonNoise = "";
this.subJsonNoises = "";
this.subJsonMux = "";
this.subJsonRules = "";