|
@@ -6,7 +6,7 @@ const Protocols = {
|
|
VLESS: "vless",
|
|
VLESS: "vless",
|
|
Trojan: "trojan",
|
|
Trojan: "trojan",
|
|
Shadowsocks: "shadowsocks",
|
|
Shadowsocks: "shadowsocks",
|
|
- Mixed: "mixed",
|
|
|
|
|
|
+ Socks: "socks",
|
|
HTTP: "http",
|
|
HTTP: "http",
|
|
Wireguard: "wireguard"
|
|
Wireguard: "wireguard"
|
|
};
|
|
};
|
|
@@ -643,7 +643,7 @@ class Outbound extends CommonClass {
|
|
Protocols.Trojan,
|
|
Protocols.Trojan,
|
|
Protocols.Shadowsocks,
|
|
Protocols.Shadowsocks,
|
|
Protocols.HTTP,
|
|
Protocols.HTTP,
|
|
- Protocols.Mixed
|
|
|
|
|
|
+ Protocols.Socks
|
|
].includes(this.protocol);
|
|
].includes(this.protocol);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -652,7 +652,7 @@ class Outbound extends CommonClass {
|
|
}
|
|
}
|
|
|
|
|
|
hasServers() {
|
|
hasServers() {
|
|
- return [Protocols.Trojan, Protocols.Shadowsocks, Protocols.Mixed, Protocols.HTTP].includes(this.protocol);
|
|
|
|
|
|
+ return [Protocols.Trojan, Protocols.Shadowsocks, Protocols.Socks, Protocols.HTTP].includes(this.protocol);
|
|
}
|
|
}
|
|
|
|
|
|
hasAddressPort() {
|
|
hasAddressPort() {
|
|
@@ -662,13 +662,13 @@ class Outbound extends CommonClass {
|
|
Protocols.VLESS,
|
|
Protocols.VLESS,
|
|
Protocols.Trojan,
|
|
Protocols.Trojan,
|
|
Protocols.Shadowsocks,
|
|
Protocols.Shadowsocks,
|
|
- Protocols.Mixed,
|
|
|
|
|
|
+ Protocols.Socks,
|
|
Protocols.HTTP
|
|
Protocols.HTTP
|
|
].includes(this.protocol);
|
|
].includes(this.protocol);
|
|
}
|
|
}
|
|
|
|
|
|
hasUsername() {
|
|
hasUsername() {
|
|
- return [Protocols.Mixed, Protocols.HTTP].includes(this.protocol);
|
|
|
|
|
|
+ return [Protocols.Socks, Protocols.HTTP].includes(this.protocol);
|
|
}
|
|
}
|
|
|
|
|
|
static fromJson(json = {}) {
|
|
static fromJson(json = {}) {
|
|
@@ -847,7 +847,7 @@ Outbound.Settings = class extends CommonClass {
|
|
case Protocols.VLESS: return new Outbound.VLESSSettings();
|
|
case Protocols.VLESS: return new Outbound.VLESSSettings();
|
|
case Protocols.Trojan: return new Outbound.TrojanSettings();
|
|
case Protocols.Trojan: return new Outbound.TrojanSettings();
|
|
case Protocols.Shadowsocks: return new Outbound.ShadowsocksSettings();
|
|
case Protocols.Shadowsocks: return new Outbound.ShadowsocksSettings();
|
|
- case Protocols.Mixed: return new Outbound.MixedSettings();
|
|
|
|
|
|
+ case Protocols.Socks: return new Outbound.SocksSettings();
|
|
case Protocols.HTTP: return new Outbound.HttpSettings();
|
|
case Protocols.HTTP: return new Outbound.HttpSettings();
|
|
case Protocols.Wireguard: return new Outbound.WireguardSettings();
|
|
case Protocols.Wireguard: return new Outbound.WireguardSettings();
|
|
default: return null;
|
|
default: return null;
|
|
@@ -863,7 +863,7 @@ Outbound.Settings = class extends CommonClass {
|
|
case Protocols.VLESS: return Outbound.VLESSSettings.fromJson(json);
|
|
case Protocols.VLESS: return Outbound.VLESSSettings.fromJson(json);
|
|
case Protocols.Trojan: return Outbound.TrojanSettings.fromJson(json);
|
|
case Protocols.Trojan: return Outbound.TrojanSettings.fromJson(json);
|
|
case Protocols.Shadowsocks: return Outbound.ShadowsocksSettings.fromJson(json);
|
|
case Protocols.Shadowsocks: return Outbound.ShadowsocksSettings.fromJson(json);
|
|
- case Protocols.Mixed: return Outbound.MixedSettings.fromJson(json);
|
|
|
|
|
|
+ case Protocols.Socks: return Outbound.SocksSettings.fromJson(json);
|
|
case Protocols.HTTP: return Outbound.HttpSettings.fromJson(json);
|
|
case Protocols.HTTP: return Outbound.HttpSettings.fromJson(json);
|
|
case Protocols.Wireguard: return Outbound.WireguardSettings.fromJson(json);
|
|
case Protocols.Wireguard: return Outbound.WireguardSettings.fromJson(json);
|
|
default: return null;
|
|
default: return null;
|
|
@@ -1141,7 +1141,7 @@ Outbound.ShadowsocksSettings = class extends CommonClass {
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
-Outbound.MixedSettings = class extends CommonClass {
|
|
|
|
|
|
+Outbound.SocksSettings = class extends CommonClass {
|
|
constructor(address, port, user, pass) {
|
|
constructor(address, port, user, pass) {
|
|
super();
|
|
super();
|
|
this.address = address;
|
|
this.address = address;
|
|
@@ -1153,7 +1153,7 @@ Outbound.MixedSettings = class extends CommonClass {
|
|
static fromJson(json = {}) {
|
|
static fromJson(json = {}) {
|
|
let servers = json.servers;
|
|
let servers = json.servers;
|
|
if (ObjectUtil.isArrEmpty(servers)) servers = [{ users: [{}] }];
|
|
if (ObjectUtil.isArrEmpty(servers)) servers = [{ users: [{}] }];
|
|
- return new Outbound.MixedSettings(
|
|
|
|
|
|
+ return new Outbound.SocksSettings(
|
|
servers[0].address,
|
|
servers[0].address,
|
|
servers[0].port,
|
|
servers[0].port,
|
|
ObjectUtil.isArrEmpty(servers[0].users) ? '' : servers[0].users[0].user,
|
|
ObjectUtil.isArrEmpty(servers[0].users) ? '' : servers[0].users[0].user,
|