mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-09-10 18:34:18 +08:00
🌈 Sync 2026-07-19 23:47:22
This commit is contained in:
@@ -345,6 +345,8 @@ uci.foreach(uciconf, uciinbd, (cfg) => {
|
||||
|
||||
const listener = parseListener(cfg);
|
||||
listener.proxy = get_proxy(listener.proxy);
|
||||
if (listener["shadow-tls"])
|
||||
listener["shadow-tls"].handshake.proxy = get_proxy(listener["shadow-tls"].handshake.proxy);
|
||||
if (listener["res-tls"])
|
||||
listener["res-tls"].proxy = get_proxy(listener["res-tls"].proxy);
|
||||
if (listener["jls-config"])
|
||||
@@ -541,7 +543,7 @@ uci.foreach(uciconf, ucinode, (cfg) => {
|
||||
|
||||
/* Snell */
|
||||
psk: cfg.snell_psk,
|
||||
version: cfg.snell_version,
|
||||
version: strToInt(cfg.snell_version),
|
||||
reuse: strToBool(cfg.snell_reuse),
|
||||
|
||||
/* VMess / VLESS */
|
||||
@@ -641,38 +643,49 @@ uci.foreach(uciconf, ucinode, (cfg) => {
|
||||
|
||||
/* Plugin fields */
|
||||
...(cfg.plugin === '1' ? (
|
||||
cfg.type === 'snell' ? {
|
||||
// snell
|
||||
"obfs-opts": {
|
||||
mode: cfg.plugin_type === 'shadow-tls' ? cfg.plugin_type : cfg.plugin_opts_obfsmode,
|
||||
host: cfg.plugin_opts_host,
|
||||
password: cfg.plugin_opts_thetlspassword,
|
||||
cfg.type in ['vmess', 'vless', 'trojan', 'anytls'] ? {
|
||||
...arrToObj([[(cfg.type in ['vmess', 'vless']) ? 'servername' : 'sni', cfg.plugin_opts_host]]),
|
||||
// shadow-tls
|
||||
"shadow-tls-opts": cfg.plugin_type === 'shadow-tls' ? {
|
||||
version: strToInt(cfg.plugin_opts_shadowtls_version),
|
||||
alpn: cfg.tls_alpn // Array
|
||||
}
|
||||
} : {
|
||||
// others
|
||||
plugin: cfg.plugin_type,
|
||||
"plugin-opts": {
|
||||
mode: cfg.plugin_opts_obfsmode,
|
||||
host: cfg.plugin_opts_host,
|
||||
username: cfg.plugin_opts_thetlsusername,
|
||||
password: cfg.plugin_opts_thetlspassword
|
||||
} : null,
|
||||
// restls
|
||||
"restls-opts": cfg.plugin_type === 'restls' ? {
|
||||
password: cfg.plugin_opts_thetlspassword,
|
||||
version: strToInt(cfg.plugin_opts_shadowtls_version),
|
||||
alpn: cfg.tls_alpn, // Array
|
||||
"version-hint": cfg.plugin_opts_restls_versionhint,
|
||||
"restls-script": cfg.plugin_opts_restls_script
|
||||
}
|
||||
} : null,
|
||||
// jls
|
||||
"jls-opts": cfg.plugin_type === 'jls' ? {
|
||||
username: cfg.plugin_opts_thetlsusername,
|
||||
password: cfg.plugin_opts_thetlspassword
|
||||
} : null,
|
||||
} : {
|
||||
// snell / shadowsocks
|
||||
plugin: cfg.type === 'snell' ? null : cfg.plugin_type,
|
||||
...arrToObj([[cfg.type === 'snell' ? "obfs-opts" : "plugin-opts",
|
||||
{
|
||||
mode: (cfg.type === 'snell' && cfg.plugin_type !== 'obfs') ? cfg.plugin_type : cfg.plugin_opts_obfsmode,
|
||||
host: cfg.plugin_opts_host,
|
||||
username: cfg.plugin_opts_thetlsusername,
|
||||
password: cfg.plugin_opts_thetlspassword,
|
||||
version: strToInt(cfg.plugin_opts_shadowtls_version),
|
||||
alpn: cfg.tls_alpn, // Array
|
||||
"version-hint": cfg.plugin_opts_restls_versionhint,
|
||||
"restls-script": cfg.plugin_opts_restls_script
|
||||
}
|
||||
]])
|
||||
}
|
||||
) : {}),
|
||||
|
||||
/* SSH / WireGuard / Masque */
|
||||
/* TLS fields */
|
||||
tls: (cfg.type in ['trojan', 'anytls', 'tuic', 'hysteria', 'hysteria2', 'shadowquic', 'trusttunnel']) ? null : strToBool(cfg.tls),
|
||||
tls: (cfg.type in ['trojan', 'anytls', 'tuic', 'hysteria', 'hysteria2', 'shadowquic', 'trusttunnel', 'masque']) ? null : strToBool(cfg.tls),
|
||||
"disable-sni": strToBool(cfg.tls_disable_sni),
|
||||
...arrToObj([[(cfg.type in ['vmess', 'vless']) ? 'servername' : 'sni', cfg.tls_sni]]),
|
||||
...(cfg.tls_sni ? arrToObj([[(cfg.type in ['vmess', 'vless']) ? 'servername' : 'sni', cfg.tls_sni]]) : {}),
|
||||
fingerprint: cfg.tls_fingerprint,
|
||||
alpn: cfg.plugin_type in ['shadow-tls', 'jls'] ? null : cfg.tls_alpn, // Array
|
||||
alpn: cfg.tls === '1' ? cfg.tls_alpn : null, // Array
|
||||
"name-cert-verify": cfg.tls_name_cert_verify,
|
||||
"skip-cert-verify": strToBool(cfg.tls_skip_cert_verify),
|
||||
certificate: cfg.tls_cert_path, // mTLS
|
||||
@@ -684,10 +697,6 @@ uci.foreach(uciconf, ucinode, (cfg) => {
|
||||
config: cfg.tls_ech_config,
|
||||
"query-server-name": cfg.tls_ech_query_server_name
|
||||
} : null,
|
||||
"jls-opts": cfg.tls_jls === '1' ? {
|
||||
"username": cfg.tls_jls_username,
|
||||
"password": cfg.tls_jls_password
|
||||
} : null,
|
||||
"reality-opts": cfg.tls_reality === '1' ? {
|
||||
"public-key": cfg.tls_reality_public_key,
|
||||
"short-id": cfg.tls_reality_short_id,
|
||||
|
||||
Reference in New Issue
Block a user