update 2024-03-08 20:27:51
This commit is contained in:
parent
072e3f4814
commit
ddfbde6fa7
|
@ -131,6 +131,13 @@ function stream_quic(server) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function port_array(i) {
|
||||||
|
if (type(i) === 'array') {
|
||||||
|
return map(i, v => int(v));
|
||||||
|
}
|
||||||
|
return [int(i)];
|
||||||
|
};
|
||||||
|
|
||||||
export function stream_settings(server, protocol, tag) {
|
export function stream_settings(server, protocol, tag) {
|
||||||
const security = server[protocol + "_tls"];
|
const security = server[protocol + "_tls"];
|
||||||
let tlsSettings = null;
|
let tlsSettings = null;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import { stream_settings } from "../common/stream.mjs";
|
import { port_array, stream_settings } from "../common/stream.mjs";
|
||||||
|
|
||||||
export function http_outbound(server, tag) {
|
export function http_outbound(server, tag) {
|
||||||
const stream_settings_object = stream_settings(server, "http", tag);
|
const stream_settings_object = stream_settings(server, "http", tag);
|
||||||
|
@ -20,13 +20,13 @@ export function http_outbound(server, tag) {
|
||||||
protocol: "http",
|
protocol: "http",
|
||||||
tag: tag,
|
tag: tag,
|
||||||
settings: {
|
settings: {
|
||||||
servers: [
|
servers: map(port_array(server["server_port"]), function (v) {
|
||||||
{
|
return {
|
||||||
address: server["server"],
|
address: server["server"],
|
||||||
port: int(server["server_port"]),
|
port: v,
|
||||||
users: users
|
users: users
|
||||||
}
|
};
|
||||||
]
|
})
|
||||||
},
|
},
|
||||||
streamSettings: stream_settings_result
|
streamSettings: stream_settings_result
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import { stream_settings } from "../common/stream.mjs";
|
import { port_array, stream_settings } from "../common/stream.mjs";
|
||||||
|
|
||||||
export function shadowsocks_outbound(server, tag) {
|
export function shadowsocks_outbound(server, tag) {
|
||||||
const stream_settings_object = stream_settings(server, "shadowsocks", tag);
|
const stream_settings_object = stream_settings(server, "shadowsocks", tag);
|
||||||
|
@ -11,16 +11,16 @@ export function shadowsocks_outbound(server, tag) {
|
||||||
protocol: "shadowsocks",
|
protocol: "shadowsocks",
|
||||||
tag: tag,
|
tag: tag,
|
||||||
settings: {
|
settings: {
|
||||||
servers: [
|
servers: map(port_array(server["server_port"]), function (v) {
|
||||||
{
|
return {
|
||||||
address: server["server"],
|
address: server["server"],
|
||||||
port: int(server["server_port"]),
|
port: v,
|
||||||
email: server["username"],
|
email: server["username"],
|
||||||
password: server["password"],
|
password: server["password"],
|
||||||
method: server["shadowsocks_security"],
|
method: server["shadowsocks_security"],
|
||||||
uot: server["shadowsocks_udp_over_tcp"] == '1'
|
uot: server["shadowsocks_udp_over_tcp"] == '1'
|
||||||
}
|
};
|
||||||
]
|
})
|
||||||
},
|
},
|
||||||
streamSettings: stream_settings_result
|
streamSettings: stream_settings_result
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import { stream_settings } from "../common/stream.mjs";
|
import { port_array, stream_settings } from "../common/stream.mjs";
|
||||||
|
|
||||||
export function socks_outbound(server, tag) {
|
export function socks_outbound(server, tag) {
|
||||||
const stream_settings_object = stream_settings(server, "socks", tag);
|
const stream_settings_object = stream_settings(server, "socks", tag);
|
||||||
|
@ -20,13 +20,13 @@ export function socks_outbound(server, tag) {
|
||||||
protocol: "socks",
|
protocol: "socks",
|
||||||
tag: tag,
|
tag: tag,
|
||||||
settings: {
|
settings: {
|
||||||
servers: [
|
servers: map(port_array(server["server_port"]), function (v) {
|
||||||
{
|
return {
|
||||||
address: server["server"],
|
address: server["server"],
|
||||||
port: int(server["server_port"]),
|
port: v,
|
||||||
users: users
|
users: users
|
||||||
}
|
}
|
||||||
]
|
})
|
||||||
},
|
},
|
||||||
streamSettings: stream_settings_result
|
streamSettings: stream_settings_result
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import { stream_settings } from "../common/stream.mjs";
|
import { port_array, stream_settings } from "../common/stream.mjs";
|
||||||
import { fallbacks, tls_inbound_settings } from "../common/tls.mjs";
|
import { fallbacks, tls_inbound_settings } from "../common/tls.mjs";
|
||||||
|
|
||||||
function trojan_inbound_user(k) {
|
function trojan_inbound_user(k) {
|
||||||
|
@ -19,14 +19,14 @@ export function trojan_outbound(server, tag) {
|
||||||
protocol: "trojan",
|
protocol: "trojan",
|
||||||
tag: tag,
|
tag: tag,
|
||||||
settings: {
|
settings: {
|
||||||
servers: [
|
servers: map(port_array(server["server_port"]), function (v) {
|
||||||
{
|
return {
|
||||||
address: server["server"],
|
address: server["server"],
|
||||||
port: int(server["server_port"]),
|
port: v,
|
||||||
email: server["username"],
|
email: server["username"],
|
||||||
password: server["password"]
|
password: server["password"]
|
||||||
}
|
};
|
||||||
]
|
})
|
||||||
},
|
},
|
||||||
streamSettings: stream_settings_result
|
streamSettings: stream_settings_result
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import { stream_settings } from "../common/stream.mjs";
|
import { port_array, stream_settings } from "../common/stream.mjs";
|
||||||
import { fallbacks, reality_inbound_settings, tls_inbound_settings } from "../common/tls.mjs";
|
import { fallbacks, reality_inbound_settings, tls_inbound_settings } from "../common/tls.mjs";
|
||||||
|
|
||||||
function vless_inbound_user(k, flow) {
|
function vless_inbound_user(k, flow) {
|
||||||
|
@ -29,10 +29,10 @@ export function vless_outbound(server, tag) {
|
||||||
protocol: "vless",
|
protocol: "vless",
|
||||||
tag: tag,
|
tag: tag,
|
||||||
settings: {
|
settings: {
|
||||||
vnext: [
|
vnext: map(port_array(server["server_port"]), function (v) {
|
||||||
{
|
return {
|
||||||
address: server["server"],
|
address: server["server"],
|
||||||
port: int(server["server_port"]),
|
port: v,
|
||||||
users: [
|
users: [
|
||||||
{
|
{
|
||||||
email: server["username"],
|
email: server["username"],
|
||||||
|
@ -42,7 +42,7 @@ export function vless_outbound(server, tag) {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
})
|
||||||
},
|
},
|
||||||
streamSettings: stream_settings_result
|
streamSettings: stream_settings_result
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import { stream_settings } from "../common/stream.mjs";
|
import { port_array, stream_settings } from "../common/stream.mjs";
|
||||||
|
|
||||||
export function vmess_outbound(server, tag) {
|
export function vmess_outbound(server, tag) {
|
||||||
const stream_settings_object = stream_settings(server, "vmess", tag);
|
const stream_settings_object = stream_settings(server, "vmess", tag);
|
||||||
|
@ -11,10 +11,10 @@ export function vmess_outbound(server, tag) {
|
||||||
protocol: "vmess",
|
protocol: "vmess",
|
||||||
tag: tag,
|
tag: tag,
|
||||||
settings: {
|
settings: {
|
||||||
vnext: [
|
vnext: map(port_array(server["server_port"]), function (v) {
|
||||||
{
|
return {
|
||||||
address: server["server"],
|
address: server["server"],
|
||||||
port: int(server["server_port"]),
|
port: v,
|
||||||
users: [
|
users: [
|
||||||
{
|
{
|
||||||
email: server["username"],
|
email: server["username"],
|
||||||
|
@ -23,8 +23,8 @@ export function vmess_outbound(server, tag) {
|
||||||
security: server["vmess_security"]
|
security: server["vmess_security"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
};
|
||||||
]
|
})
|
||||||
},
|
},
|
||||||
streamSettings: stream_settings_result
|
streamSettings: stream_settings_result
|
||||||
},
|
},
|
||||||
|
|
|
@ -184,6 +184,7 @@ return view.extend({
|
||||||
ss.addremove = true;
|
ss.addremove = true;
|
||||||
|
|
||||||
ss.tab('general', _('General Settings'));
|
ss.tab('general', _('General Settings'));
|
||||||
|
ss.nodescriptions = true;
|
||||||
|
|
||||||
o = ss.taboption('general', form.Value, "alias", _("Alias (optional)"));
|
o = ss.taboption('general', form.Value, "alias", _("Alias (optional)"));
|
||||||
o.optional = true;
|
o.optional = true;
|
||||||
|
@ -192,15 +193,15 @@ return view.extend({
|
||||||
o.datatype = 'host';
|
o.datatype = 'host';
|
||||||
o.rmempty = false;
|
o.rmempty = false;
|
||||||
|
|
||||||
o = ss.taboption('general', form.Value, 'server_port', _('Server Port'));
|
o = ss.taboption('general', form.DynamicList, 'server_port', _('Server Port'));
|
||||||
o.datatype = 'port';
|
o.datatype = 'port';
|
||||||
o.rmempty = false;
|
o.rmempty = false;
|
||||||
|
o.modalonly = true;
|
||||||
|
|
||||||
o = ss.taboption('general', form.Value, 'username', _('Email / Username'), _('Optional; username for SOCKS / HTTP outbound, email for other outbound.'));
|
o = ss.taboption('general', form.Value, 'username', _('Email / Username'), _('Optional; username for SOCKS / HTTP outbound, email for other outbound.'));
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
|
|
||||||
o = ss.taboption('general', form.Value, 'password', _('UserId / Password'), _('Fill user_id for vmess / VLESS, or password for other outbound (also supports <a href="https://github.com/XTLS/Xray-core/issues/158">Xray UUID Mapping</a>)'));
|
o = ss.taboption('general', form.Value, 'password', _('UserId / Password'), _('Fill user_id for vmess / VLESS, or password for other outbound (also supports <a href="https://github.com/XTLS/Xray-core/issues/158">Xray UUID Mapping</a>)'));
|
||||||
o.modalonly = true;
|
|
||||||
o.rmempty = false;
|
o.rmempty = false;
|
||||||
|
|
||||||
ss.tab('resolving', _("Server Hostname Resolving"));
|
ss.tab('resolving', _("Server Hostname Resolving"));
|
||||||
|
|
Loading…
Reference in New Issue