mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-09-12 13:10:05 +00:00
outbound: mixed to socks
Some checks are pending
Release 3X-UI / build (386) (push) Waiting to run
Release 3X-UI / build (amd64) (push) Waiting to run
Release 3X-UI / build (arm64) (push) Waiting to run
Release 3X-UI / build (armv5) (push) Waiting to run
Release 3X-UI / build (armv6) (push) Waiting to run
Release 3X-UI / build (armv7) (push) Waiting to run
Release 3X-UI / build (s390x) (push) Waiting to run
Release 3X-UI / Build for Windows (push) Waiting to run
Some checks are pending
Release 3X-UI / build (386) (push) Waiting to run
Release 3X-UI / build (amd64) (push) Waiting to run
Release 3X-UI / build (arm64) (push) Waiting to run
Release 3X-UI / build (armv5) (push) Waiting to run
Release 3X-UI / build (armv6) (push) Waiting to run
Release 3X-UI / build (armv7) (push) Waiting to run
Release 3X-UI / build (s390x) (push) Waiting to run
Release 3X-UI / Build for Windows (push) Waiting to run
This commit is contained in:
parent
b1ea8005e4
commit
610d29765a
2 changed files with 11 additions and 11 deletions
|
@ -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,
|
||||||
|
|
|
@ -241,9 +241,9 @@
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- Servers (trojan/shadowsocks/mixed/http) settings -->
|
<!-- Servers (trojan/shadowsocks/socks/http) settings -->
|
||||||
<template v-if="outbound.hasServers()">
|
<template v-if="outbound.hasServers()">
|
||||||
<!-- http / mixed -->
|
<!-- http / socks -->
|
||||||
<template v-if="outbound.hasUsername()">
|
<template v-if="outbound.hasUsername()">
|
||||||
<a-form-item label='{{ i18n "username" }}'>
|
<a-form-item label='{{ i18n "username" }}'>
|
||||||
<a-input v-model.trim="outbound.settings.user"></a-input>
|
<a-input v-model.trim="outbound.settings.user"></a-input>
|
||||||
|
|
Loading…
Reference in a new issue