mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2026-12-03 09:45:54 +00:00
feat: 给节点添加 shadow-tls 不再支持 shadow-tls-password/shadow-tls-sni/shadow-tls-version . 请使用 plugin: 'shadow-tls' 和 plugin-opts: { password, host, version }
This commit is contained in:
12 files changed
+149
-370
No files matched your search
@@ -1027,20 +1027,6 @@ function lastParse(proxy) {
|
||||
if (!proxy['tls-fingerprint'] && caStr) {
|
||||
proxy['tls-fingerprint'] = rs.generateFingerprint(caStr);
|
||||
}
|
||||
if (
|
||||
['ss'].includes(proxy.type) &&
|
||||
isPresent(proxy, 'shadow-tls-password')
|
||||
) {
|
||||
proxy.plugin = 'shadow-tls';
|
||||
proxy['plugin-opts'] = {
|
||||
host: proxy['shadow-tls-sni'],
|
||||
password: proxy['shadow-tls-password'],
|
||||
version: proxy['shadow-tls-version'],
|
||||
};
|
||||
delete proxy['shadow-tls-sni'];
|
||||
delete proxy['shadow-tls-password'];
|
||||
delete proxy['shadow-tls-version'];
|
||||
}
|
||||
if (['tuic'].includes(proxy.type)) {
|
||||
proxy.alpn = Array.isArray(proxy.alpn)
|
||||
? proxy.alpn
|
||||
|
||||
@@ -19,6 +19,7 @@ const grammars = String.raw`
|
||||
const proxy = {};
|
||||
const obfs = {};
|
||||
const transport = {};
|
||||
const shadowTLS = {};
|
||||
const $ = {};
|
||||
|
||||
function handleTransport() {
|
||||
@@ -34,6 +35,17 @@ const grammars = String.raw`
|
||||
}
|
||||
}
|
||||
|
||||
function handleShadowTLS() {
|
||||
if (shadowTLS.password) {
|
||||
proxy.plugin = "shadow-tls";
|
||||
proxy["plugin-opts"] = {
|
||||
host: shadowTLS.host,
|
||||
password: shadowTLS.password,
|
||||
version: shadowTLS.version,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function normalizeVmessSecurity(security) {
|
||||
const normalized = String(security || "").trim().toLowerCase();
|
||||
const supported = ["none", "auto", "aes-128-gcm", "chacha20-ietf-poly1305"];
|
||||
@@ -60,6 +72,7 @@ shadowsocksr = tag equals "shadowsocksr"i address method password (ssr_protocol/
|
||||
proxy.type = "ssr";
|
||||
// handle ssr obfs
|
||||
proxy.obfs = obfs.type;
|
||||
handleShadowTLS();
|
||||
}
|
||||
shadowsocks = tag equals "shadowsocks"i address method password (obfs_typev obfs_hostv)? (obfs_ss/obfs_host/obfs_uri/fast_open/udp_relay/udp_port/shadow_tls_version/shadow_tls_sni/shadow_tls_password/ip_mode/block_quic/udp_over_tcp/others)* {
|
||||
proxy.type = "ss";
|
||||
@@ -70,6 +83,7 @@ shadowsocks = tag equals "shadowsocks"i address method password (obfs_typev obfs
|
||||
$set(proxy, "plugin-opts.host", obfs.host);
|
||||
$set(proxy, "plugin-opts.path", obfs.path);
|
||||
}
|
||||
handleShadowTLS();
|
||||
}
|
||||
vmess = tag equals "vmess"i address vmess_method uuid (transport/transport_host/transport_path/over_tls/tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/tls_profile/alpn/vmess_alterId/fast_open/udp_relay/ip_mode/public_key/short_id/block_quic/others)* {
|
||||
proxy.type = "vmess";
|
||||
@@ -194,9 +208,9 @@ ssr_protocol_param = comma "protocol-param" equals param:$[^=,]+ { proxy["protoc
|
||||
vmess_alterId = comma "alterId" equals alterId:$[0-9]+ { proxy.alterId = parseInt(alterId); }
|
||||
|
||||
udp_port = comma "udp-port" equals match:$[0-9]+ { proxy["udp-port"] = parseInt(match.trim()); }
|
||||
shadow_tls_version = comma "shadow-tls-version" equals match:$[0-9]+ { proxy["shadow-tls-version"] = parseInt(match.trim()); }
|
||||
shadow_tls_sni = comma "shadow-tls-sni" equals match:[^,]+ { proxy["shadow-tls-sni"] = match.join(""); }
|
||||
shadow_tls_password = comma "shadow-tls-password" equals match:[^,]+ { proxy["shadow-tls-password"] = match.join("").replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
|
||||
shadow_tls_version = comma "shadow-tls-version" equals match:$[0-9]+ { shadowTLS.version = parseInt(match.trim()); }
|
||||
shadow_tls_sni = comma "shadow-tls-sni" equals match:[^,]+ { shadowTLS.host = match.join(""); }
|
||||
shadow_tls_password = comma "shadow-tls-password" equals match:[^,]+ { shadowTLS.password = match.join("").replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
|
||||
|
||||
over_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }
|
||||
tls_name = comma sni:("tls-name") equals match:[^,]+ { proxy.sni = match.join("").replace(/^"(.*)"$/, '$1'); }
|
||||
|
||||
@@ -18,6 +18,7 @@ const grammars = String.raw`
|
||||
{
|
||||
const proxy = {};
|
||||
const obfs = {};
|
||||
const shadowTLS = {};
|
||||
const $ = {};
|
||||
|
||||
function handleWebsocket() {
|
||||
@@ -31,8 +32,16 @@ const grammars = String.raw`
|
||||
}
|
||||
}
|
||||
function handleShadowTLS() {
|
||||
if (proxy['shadow-tls-password'] && !proxy['shadow-tls-version']) {
|
||||
proxy['shadow-tls-version'] = 2;
|
||||
if (shadowTLS.password && !shadowTLS.version) {
|
||||
shadowTLS.version = 2;
|
||||
}
|
||||
if (shadowTLS.password) {
|
||||
proxy.plugin = "shadow-tls";
|
||||
proxy["plugin-opts"] = {
|
||||
host: shadowTLS.host,
|
||||
password: shadowTLS.password,
|
||||
version: shadowTLS.version,
|
||||
};
|
||||
}
|
||||
}
|
||||
function stripQuotes(value) {
|
||||
@@ -594,9 +603,9 @@ private_key = comma "private-key" equals match:[^,]+ { proxy["keystore-private-k
|
||||
server_fingerprint = comma "server-fingerprint" equals match:[^,]+ { proxy["server-fingerprint"] = match.join("").replace(/^"(.*)"$/, '$1'); }
|
||||
block_quic = comma "block-quic" equals match:[^,]+ { proxy["block-quic"] = match.join(""); }
|
||||
udp_port = comma "udp-port" equals match:$[0-9]+ { proxy["udp-port"] = parseInt(match.trim()); }
|
||||
shadow_tls_version = comma "shadow-tls-version" equals match:$[0-9]+ { proxy["shadow-tls-version"] = parseInt(match.trim()); }
|
||||
shadow_tls_sni = comma "shadow-tls-sni" equals match:[^,]+ { proxy["shadow-tls-sni"] = match.join(""); }
|
||||
shadow_tls_password = comma "shadow-tls-password" equals match:[^,]+ { proxy["shadow-tls-password"] = match.join("").replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
|
||||
shadow_tls_version = comma "shadow-tls-version" equals match:$[0-9]+ { shadowTLS.version = parseInt(match.trim()); }
|
||||
shadow_tls_sni = comma "shadow-tls-sni" equals match:[^,]+ { shadowTLS.host = match.join(""); }
|
||||
shadow_tls_password = comma "shadow-tls-password" equals match:[^,]+ { shadowTLS.password = match.join("").replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
|
||||
token = comma "token" equals match:[^,]+ { proxy.token = match.join(""); }
|
||||
alpn = comma "alpn" equals match:quoted_value {
|
||||
const values = parseAlpn(match);
|
||||
|
||||
@@ -247,21 +247,6 @@ export default function ClashMeta_Producer() {
|
||||
ds['reality-opts'] = { 'public-key': '' };
|
||||
}
|
||||
}
|
||||
} else if (proxy.type === 'ss') {
|
||||
if (
|
||||
isPresent(proxy, 'shadow-tls-password') &&
|
||||
!isPresent(proxy, 'plugin')
|
||||
) {
|
||||
proxy.plugin = 'shadow-tls';
|
||||
proxy['plugin-opts'] = {
|
||||
host: proxy['shadow-tls-sni'],
|
||||
password: proxy['shadow-tls-password'],
|
||||
version: proxy['shadow-tls-version'],
|
||||
};
|
||||
delete proxy['shadow-tls-password'];
|
||||
delete proxy['shadow-tls-sni'];
|
||||
delete proxy['shadow-tls-version'];
|
||||
}
|
||||
}
|
||||
|
||||
if (isPresent(proxy, 'plugin-opts.mux')) {
|
||||
@@ -428,22 +413,11 @@ function isSupportedMihomoVersion(version, supportedVersions) {
|
||||
}
|
||||
|
||||
function hasMihomoShadowTls(proxy) {
|
||||
return (
|
||||
proxy?.plugin === 'shadow-tls' ||
|
||||
isPresent(proxy, 'shadow-tls-password') ||
|
||||
isPresent(proxy, 'shadow-tls-sni') ||
|
||||
isPresent(proxy, 'shadow-tls-version')
|
||||
);
|
||||
return proxy?.plugin === 'shadow-tls';
|
||||
}
|
||||
|
||||
function getMihomoShadowTlsVersion(proxy) {
|
||||
if (isPresent(proxy, 'shadow-tls-version')) {
|
||||
return proxy['shadow-tls-version'];
|
||||
}
|
||||
|
||||
if (proxy?.plugin === 'shadow-tls') {
|
||||
return proxy?.['plugin-opts']?.version;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
return proxy?.plugin === 'shadow-tls'
|
||||
? proxy?.['plugin-opts']?.version
|
||||
: undefined;
|
||||
}
|
||||
@@ -554,16 +554,7 @@ export default function Egern_Producer() {
|
||||
'ssh',
|
||||
].includes(original.type)
|
||||
) {
|
||||
if (isPresent(original, 'shadow-tls-password')) {
|
||||
if (original['shadow-tls-version'] != 3)
|
||||
throw new Error(
|
||||
`shadow-tls version ${original['shadow-tls-version']} is not supported`,
|
||||
);
|
||||
proxy.shadow_tls = {
|
||||
password: original['shadow-tls-password'],
|
||||
sni: original['shadow-tls-sni'],
|
||||
};
|
||||
} else if (
|
||||
if (
|
||||
['shadow-tls'].includes(original.plugin) &&
|
||||
original['plugin-opts']
|
||||
) {
|
||||
@@ -693,12 +684,7 @@ function getUdpRelay(proxy) {
|
||||
}
|
||||
|
||||
function hasShadowTls(proxy) {
|
||||
return (
|
||||
proxy.plugin === 'shadow-tls' ||
|
||||
isPresent(proxy, 'shadow-tls-password') ||
|
||||
isPresent(proxy, 'shadow-tls-sni') ||
|
||||
isPresent(proxy, 'shadow-tls-version')
|
||||
);
|
||||
return proxy.plugin === 'shadow-tls';
|
||||
}
|
||||
|
||||
function getNonEmptyValue(value) {
|
||||
|
||||
@@ -69,6 +69,25 @@ function appendAlpn(result, proxy) {
|
||||
if (alpn) result.append(`,alpn="${alpn}"`);
|
||||
}
|
||||
|
||||
function appendShadowTLS(result, proxy) {
|
||||
if (proxy.plugin !== 'shadow-tls' || !proxy['plugin-opts']) return;
|
||||
|
||||
const password = proxy['plugin-opts'].password;
|
||||
const host = proxy['plugin-opts'].host;
|
||||
const version = proxy['plugin-opts'].version;
|
||||
if (!password) return;
|
||||
|
||||
result.append(`,shadow-tls-password=${password}`);
|
||||
if (host) result.append(`,shadow-tls-sni=${host}`);
|
||||
if (version) {
|
||||
if (version < 2) {
|
||||
throw new Error(`shadow-tls version ${version} is not supported`);
|
||||
}
|
||||
result.append(`,shadow-tls-version=${version}`);
|
||||
}
|
||||
result.appendIfPresent(`,udp-port=${proxy['udp-port']}`, 'udp-port');
|
||||
}
|
||||
|
||||
function appendReality(result, proxy) {
|
||||
result.appendIfPresent(`,sni=${proxy.sni}`, 'sni');
|
||||
result.appendIfPresent(
|
||||
@@ -156,44 +175,7 @@ function shadowsocks(proxy) {
|
||||
}
|
||||
}
|
||||
|
||||
// shadow-tls
|
||||
if (isPresent(proxy, 'shadow-tls-password')) {
|
||||
result.append(`,shadow-tls-password=${proxy['shadow-tls-password']}`);
|
||||
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-version=${proxy['shadow-tls-version']}`,
|
||||
'shadow-tls-version',
|
||||
);
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-sni=${proxy['shadow-tls-sni']}`,
|
||||
'shadow-tls-sni',
|
||||
);
|
||||
// udp-port
|
||||
result.appendIfPresent(`,udp-port=${proxy['udp-port']}`, 'udp-port');
|
||||
} else if (['shadow-tls'].includes(proxy.plugin) && proxy['plugin-opts']) {
|
||||
const password = proxy['plugin-opts'].password;
|
||||
const host = proxy['plugin-opts'].host;
|
||||
const version = proxy['plugin-opts'].version;
|
||||
if (password) {
|
||||
result.append(`,shadow-tls-password=${password}`);
|
||||
if (host) {
|
||||
result.append(`,shadow-tls-sni=${host}`);
|
||||
}
|
||||
if (version) {
|
||||
if (version < 2) {
|
||||
throw new Error(
|
||||
`shadow-tls version ${version} is not supported`,
|
||||
);
|
||||
}
|
||||
result.append(`,shadow-tls-version=${version}`);
|
||||
}
|
||||
// udp-port
|
||||
result.appendIfPresent(
|
||||
`,udp-port=${proxy['udp-port']}`,
|
||||
'udp-port',
|
||||
);
|
||||
}
|
||||
}
|
||||
appendShadowTLS(result, proxy);
|
||||
|
||||
// udp over tcp
|
||||
if (proxy['udp-over-tcp']) {
|
||||
@@ -250,44 +232,7 @@ function shadowsocksr(proxy) {
|
||||
result.appendIfPresent(`,obfs=${proxy.obfs}`, 'obfs');
|
||||
result.appendIfPresent(`,obfs-param=${proxy['obfs-param']}`, 'obfs-param');
|
||||
|
||||
// shadow-tls
|
||||
if (isPresent(proxy, 'shadow-tls-password')) {
|
||||
result.append(`,shadow-tls-password=${proxy['shadow-tls-password']}`);
|
||||
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-version=${proxy['shadow-tls-version']}`,
|
||||
'shadow-tls-version',
|
||||
);
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-sni=${proxy['shadow-tls-sni']}`,
|
||||
'shadow-tls-sni',
|
||||
);
|
||||
// udp-port
|
||||
result.appendIfPresent(`,udp-port=${proxy['udp-port']}`, 'udp-port');
|
||||
} else if (['shadow-tls'].includes(proxy.plugin) && proxy['plugin-opts']) {
|
||||
const password = proxy['plugin-opts'].password;
|
||||
const host = proxy['plugin-opts'].host;
|
||||
const version = proxy['plugin-opts'].version;
|
||||
if (password) {
|
||||
result.append(`,shadow-tls-password=${password}`);
|
||||
if (host) {
|
||||
result.append(`,shadow-tls-sni=${host}`);
|
||||
}
|
||||
if (version) {
|
||||
if (version < 2) {
|
||||
throw new Error(
|
||||
`shadow-tls version ${version} is not supported`,
|
||||
);
|
||||
}
|
||||
result.append(`,shadow-tls-version=${version}`);
|
||||
}
|
||||
// udp-port
|
||||
result.appendIfPresent(
|
||||
`,udp-port=${proxy['udp-port']}`,
|
||||
'udp-port',
|
||||
);
|
||||
}
|
||||
}
|
||||
appendShadowTLS(result, proxy);
|
||||
|
||||
// tfo
|
||||
result.appendIfPresent(`,fast-open=${proxy.tfo}`, 'tfo');
|
||||
|
||||
@@ -142,20 +142,6 @@ export default function Shadowrocket_Producer() {
|
||||
delete proxy.sni;
|
||||
}
|
||||
} else if (proxy.type === 'ss') {
|
||||
if (
|
||||
isPresent(proxy, 'shadow-tls-password') &&
|
||||
!isPresent(proxy, 'plugin')
|
||||
) {
|
||||
proxy.plugin = 'shadow-tls';
|
||||
proxy['plugin-opts'] = {
|
||||
host: proxy['shadow-tls-sni'],
|
||||
password: proxy['shadow-tls-password'],
|
||||
version: proxy['shadow-tls-version'],
|
||||
};
|
||||
delete proxy['shadow-tls-password'];
|
||||
delete proxy['shadow-tls-sni'];
|
||||
delete proxy['shadow-tls-version'];
|
||||
}
|
||||
if (isShadowsocksOverTls(proxy)) {
|
||||
if (isPresent(proxy, 'sni')) {
|
||||
proxy.servername = proxy.sni;
|
||||
|
||||
@@ -529,17 +529,6 @@ const getShadowTLSPluginOpts = (proxy = {}) => {
|
||||
if (proxy.plugin === 'shadow-tls' && proxy['plugin-opts']) {
|
||||
return proxy['plugin-opts'];
|
||||
}
|
||||
if (
|
||||
proxy['shadow-tls-password'] != null ||
|
||||
proxy['shadow-tls-sni'] != null ||
|
||||
proxy['shadow-tls-version'] != null
|
||||
) {
|
||||
return {
|
||||
host: proxy['shadow-tls-sni'],
|
||||
password: proxy['shadow-tls-password'],
|
||||
version: proxy['shadow-tls-version'],
|
||||
};
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
|
||||
@@ -65,6 +65,27 @@ function appendAlpn(result, proxy) {
|
||||
if (alpn) result.append(`,alpn="${alpn}"`);
|
||||
}
|
||||
|
||||
function appendShadowTLS(result, proxy, includeUdpPort = false) {
|
||||
if (proxy.plugin !== 'shadow-tls' || !proxy['plugin-opts']) return;
|
||||
|
||||
const password = proxy['plugin-opts'].password;
|
||||
const host = proxy['plugin-opts'].host;
|
||||
const version = proxy['plugin-opts'].version;
|
||||
if (!password) return;
|
||||
|
||||
result.append(`,shadow-tls-password="${password}"`);
|
||||
if (host) result.append(`,shadow-tls-sni=${host}`);
|
||||
if (version) {
|
||||
if (version < 2) {
|
||||
throw unsupported(`shadow-tls version ${version} is not supported`);
|
||||
}
|
||||
result.append(`,shadow-tls-version=${version}`);
|
||||
}
|
||||
if (includeUdpPort) {
|
||||
result.appendIfPresent(`,udp-port=${proxy['udp-port']}`, 'udp-port');
|
||||
}
|
||||
}
|
||||
|
||||
function appendTlsProxyParams(result, proxy, enabled = true) {
|
||||
if (!enabled) {
|
||||
return;
|
||||
@@ -285,44 +306,7 @@ function shadowsocks(proxy) {
|
||||
);
|
||||
result.appendIfPresent(`,interface=${proxy['interface']}`, 'interface');
|
||||
|
||||
// shadow-tls
|
||||
if (isPresent(proxy, 'shadow-tls-password')) {
|
||||
result.append(`,shadow-tls-password="${proxy['shadow-tls-password']}"`);
|
||||
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-version=${proxy['shadow-tls-version']}`,
|
||||
'shadow-tls-version',
|
||||
);
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-sni=${proxy['shadow-tls-sni']}`,
|
||||
'shadow-tls-sni',
|
||||
);
|
||||
// udp-port
|
||||
result.appendIfPresent(`,udp-port=${proxy['udp-port']}`, 'udp-port');
|
||||
} else if (['shadow-tls'].includes(proxy.plugin) && proxy['plugin-opts']) {
|
||||
const password = proxy['plugin-opts'].password;
|
||||
const host = proxy['plugin-opts'].host;
|
||||
const version = proxy['plugin-opts'].version;
|
||||
if (password) {
|
||||
result.append(`,shadow-tls-password="${password}"`);
|
||||
if (host) {
|
||||
result.append(`,shadow-tls-sni=${host}`);
|
||||
}
|
||||
if (version) {
|
||||
if (version < 2) {
|
||||
throw unsupported(
|
||||
`shadow-tls version ${version} is not supported`,
|
||||
);
|
||||
}
|
||||
result.append(`,shadow-tls-version=${version}`);
|
||||
}
|
||||
// udp-port
|
||||
result.appendIfPresent(
|
||||
`,udp-port=${proxy['udp-port']}`,
|
||||
'udp-port',
|
||||
);
|
||||
}
|
||||
}
|
||||
appendShadowTLS(result, proxy, true);
|
||||
|
||||
// block-quic
|
||||
result.appendIfPresent(`,block-quic=${proxy['block-quic']}`, 'block-quic');
|
||||
@@ -383,19 +367,7 @@ function trojan(proxy) {
|
||||
);
|
||||
result.appendIfPresent(`,interface=${proxy['interface']}`, 'interface');
|
||||
|
||||
// shadow-tls
|
||||
if (isPresent(proxy, 'shadow-tls-password')) {
|
||||
result.append(`,shadow-tls-password="${proxy['shadow-tls-password']}"`);
|
||||
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-version=${proxy['shadow-tls-version']}`,
|
||||
'shadow-tls-version',
|
||||
);
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-sni=${proxy['shadow-tls-sni']}`,
|
||||
'shadow-tls-sni',
|
||||
);
|
||||
}
|
||||
appendShadowTLS(result, proxy);
|
||||
|
||||
// block-quic
|
||||
result.appendIfPresent(`,block-quic=${proxy['block-quic']}`, 'block-quic');
|
||||
@@ -571,18 +543,7 @@ function h2Connect(proxy) {
|
||||
);
|
||||
result.appendIfPresent(`,interface=${proxy['interface']}`, 'interface');
|
||||
|
||||
if (isPresent(proxy, 'shadow-tls-password')) {
|
||||
result.append(`,shadow-tls-password="${proxy['shadow-tls-password']}"`);
|
||||
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-version=${proxy['shadow-tls-version']}`,
|
||||
'shadow-tls-version',
|
||||
);
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-sni=${proxy['shadow-tls-sni']}`,
|
||||
'shadow-tls-sni',
|
||||
);
|
||||
}
|
||||
appendShadowTLS(result, proxy);
|
||||
|
||||
result.appendIfPresent(`,block-quic=${proxy['block-quic']}`, 'block-quic');
|
||||
result.appendIfPresent(
|
||||
@@ -651,19 +612,7 @@ function vmess(proxy, includeUnsupportedProxy) {
|
||||
);
|
||||
result.appendIfPresent(`,interface=${proxy['interface']}`, 'interface');
|
||||
|
||||
// shadow-tls
|
||||
if (isPresent(proxy, 'shadow-tls-password')) {
|
||||
result.append(`,shadow-tls-password="${proxy['shadow-tls-password']}"`);
|
||||
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-version=${proxy['shadow-tls-version']}`,
|
||||
'shadow-tls-version',
|
||||
);
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-sni=${proxy['shadow-tls-sni']}`,
|
||||
'shadow-tls-sni',
|
||||
);
|
||||
}
|
||||
appendShadowTLS(result, proxy);
|
||||
|
||||
// block-quic
|
||||
result.appendIfPresent(`,block-quic=${proxy['block-quic']}`, 'block-quic');
|
||||
@@ -784,19 +733,7 @@ function http(proxy) {
|
||||
);
|
||||
result.appendIfPresent(`,interface=${proxy['interface']}`, 'interface');
|
||||
|
||||
// shadow-tls
|
||||
if (isPresent(proxy, 'shadow-tls-password')) {
|
||||
result.append(`,shadow-tls-password="${proxy['shadow-tls-password']}"`);
|
||||
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-version=${proxy['shadow-tls-version']}`,
|
||||
'shadow-tls-version',
|
||||
);
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-sni=${proxy['shadow-tls-sni']}`,
|
||||
'shadow-tls-sni',
|
||||
);
|
||||
}
|
||||
appendShadowTLS(result, proxy);
|
||||
|
||||
// block-quic
|
||||
result.appendIfPresent(`,block-quic=${proxy['block-quic']}`, 'block-quic');
|
||||
@@ -904,19 +841,7 @@ function socks5(proxy) {
|
||||
);
|
||||
result.appendIfPresent(`,interface=${proxy['interface']}`, 'interface');
|
||||
|
||||
// shadow-tls
|
||||
if (isPresent(proxy, 'shadow-tls-password')) {
|
||||
result.append(`,shadow-tls-password="${proxy['shadow-tls-password']}"`);
|
||||
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-version=${proxy['shadow-tls-version']}`,
|
||||
'shadow-tls-version',
|
||||
);
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-sni=${proxy['shadow-tls-sni']}`,
|
||||
'shadow-tls-sni',
|
||||
);
|
||||
}
|
||||
appendShadowTLS(result, proxy);
|
||||
|
||||
// block-quic
|
||||
result.appendIfPresent(`,block-quic=${proxy['block-quic']}`, 'block-quic');
|
||||
@@ -1015,19 +940,7 @@ function snell(proxy) {
|
||||
);
|
||||
result.appendIfPresent(`,interface=${proxy['interface']}`, 'interface');
|
||||
|
||||
// shadow-tls
|
||||
if (isPresent(proxy, 'shadow-tls-password')) {
|
||||
result.append(`,shadow-tls-password="${proxy['shadow-tls-password']}"`);
|
||||
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-version=${proxy['shadow-tls-version']}`,
|
||||
'shadow-tls-version',
|
||||
);
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-sni=${proxy['shadow-tls-sni']}`,
|
||||
'shadow-tls-sni',
|
||||
);
|
||||
}
|
||||
appendShadowTLS(result, proxy);
|
||||
|
||||
// block-quic
|
||||
result.appendIfPresent(`,block-quic=${proxy['block-quic']}`, 'block-quic');
|
||||
@@ -1104,19 +1017,7 @@ function tuic(proxy) {
|
||||
);
|
||||
result.appendIfPresent(`,interface=${proxy['interface']}`, 'interface');
|
||||
|
||||
// shadow-tls
|
||||
if (isPresent(proxy, 'shadow-tls-password')) {
|
||||
result.append(`,shadow-tls-password="${proxy['shadow-tls-password']}"`);
|
||||
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-version=${proxy['shadow-tls-version']}`,
|
||||
'shadow-tls-version',
|
||||
);
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-sni=${proxy['shadow-tls-sni']}`,
|
||||
'shadow-tls-sni',
|
||||
);
|
||||
}
|
||||
appendShadowTLS(result, proxy);
|
||||
|
||||
// block-quic
|
||||
result.appendIfPresent(`,block-quic=${proxy['block-quic']}`, 'block-quic');
|
||||
@@ -1182,19 +1083,7 @@ function wireguard(proxy) {
|
||||
);
|
||||
result.appendIfPresent(`,interface=${proxy['interface']}`, 'interface');
|
||||
|
||||
// shadow-tls
|
||||
if (isPresent(proxy, 'shadow-tls-password')) {
|
||||
result.append(`,shadow-tls-password="${proxy['shadow-tls-password']}"`);
|
||||
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-version=${proxy['shadow-tls-version']}`,
|
||||
'shadow-tls-version',
|
||||
);
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-sni=${proxy['shadow-tls-sni']}`,
|
||||
'shadow-tls-sni',
|
||||
);
|
||||
}
|
||||
appendShadowTLS(result, proxy);
|
||||
|
||||
// block-quic
|
||||
result.appendIfPresent(`,block-quic=${proxy['block-quic']}`, 'block-quic');
|
||||
@@ -1283,19 +1172,7 @@ function wireguard_surge(proxy) {
|
||||
);
|
||||
result.appendIfPresent(`,interface=${proxy['interface']}`, 'interface');
|
||||
|
||||
// shadow-tls
|
||||
if (isPresent(proxy, 'shadow-tls-password')) {
|
||||
result.append(`,shadow-tls-password="${proxy['shadow-tls-password']}"`);
|
||||
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-version=${proxy['shadow-tls-version']}`,
|
||||
'shadow-tls-version',
|
||||
);
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-sni=${proxy['shadow-tls-sni']}`,
|
||||
'shadow-tls-sni',
|
||||
);
|
||||
}
|
||||
appendShadowTLS(result, proxy);
|
||||
|
||||
// block-quic
|
||||
result.appendIfPresent(`,block-quic=${proxy['block-quic']}`, 'block-quic');
|
||||
@@ -1375,19 +1252,7 @@ function hysteria2(proxy) {
|
||||
);
|
||||
result.appendIfPresent(`,interface=${proxy['interface']}`, 'interface');
|
||||
|
||||
// shadow-tls
|
||||
if (isPresent(proxy, 'shadow-tls-password')) {
|
||||
result.append(`,shadow-tls-password="${proxy['shadow-tls-password']}"`);
|
||||
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-version=${proxy['shadow-tls-version']}`,
|
||||
'shadow-tls-version',
|
||||
);
|
||||
result.appendIfPresent(
|
||||
`,shadow-tls-sni=${proxy['shadow-tls-sni']}`,
|
||||
'shadow-tls-sni',
|
||||
);
|
||||
}
|
||||
appendShadowTLS(result, proxy);
|
||||
|
||||
// block-quic
|
||||
result.appendIfPresent(`,block-quic=${proxy['block-quic']}`, 'block-quic');
|
||||
|
||||
Reference in new issue
Block a user