mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 00:52:40 +00:00
fix: vmess aead
This commit is contained in:
@@ -10,7 +10,7 @@ export default function Clash_Producer() {
|
||||
proxies
|
||||
.map((proxy) => {
|
||||
delete proxy['tls-fingerprint'];
|
||||
delete proxy['vmess-aead'];
|
||||
delete proxy['aead'];
|
||||
return ' - ' + JSON.stringify(proxy) + '\n';
|
||||
})
|
||||
.join('')
|
||||
|
||||
@@ -174,7 +174,11 @@ function vmess(proxy) {
|
||||
result.appendIfPresent(`,tls-name=${proxy.sni}`, 'sni');
|
||||
|
||||
// AEAD
|
||||
result.appendIfPresent(`,alterId=${proxy.alterId}`, 'alterId');
|
||||
if (isPresent(proxy, 'aead')) {
|
||||
result.append(`,alterId=0`);
|
||||
} else {
|
||||
result.append(`,alterId=${proxy.alterId}`);
|
||||
}
|
||||
|
||||
// tfo
|
||||
result.appendIfPresent(`,fast-open=${proxy.tfo}`, 'tfo');
|
||||
|
||||
@@ -180,12 +180,7 @@ function vmess(proxy) {
|
||||
const appendIfPresent = result.appendIfPresent.bind(result);
|
||||
|
||||
append(`vmess=${proxy.server}:${proxy.port}`);
|
||||
if (proxy.cipher === 'auto') {
|
||||
append(`,method=none`);
|
||||
} else {
|
||||
append(`,method=${proxy.cipher}`);
|
||||
}
|
||||
|
||||
append(`,method=${proxy.cipher === 'auto' ? 'none' : proxy.cipher}`);
|
||||
append(`,password=${proxy.uuid}`);
|
||||
|
||||
// obfs
|
||||
@@ -196,27 +191,19 @@ function vmess(proxy) {
|
||||
if (proxy.network === 'ws') {
|
||||
if (proxy.tls) append(`,obfs=wss`);
|
||||
else append(`,obfs=ws`);
|
||||
appendIfPresent(
|
||||
`,obfs-uri=${proxy['ws-opts'].path}`,
|
||||
'ws-opts.path',
|
||||
);
|
||||
appendIfPresent(
|
||||
`,obfs-host=${proxy['ws-opts'].headers.Host}`,
|
||||
'ws-opts.headers.Host',
|
||||
);
|
||||
} else if (proxy.network === 'http') {
|
||||
append(`,obfs=http`);
|
||||
appendIfPresent(
|
||||
`,obfs-uri=${proxy['http-opts'].path}`,
|
||||
'http-opts.path',
|
||||
);
|
||||
appendIfPresent(
|
||||
`,obfs-host=${proxy['http-opts'].headers.Host}`,
|
||||
'http-opts.headers.Host',
|
||||
);
|
||||
} else {
|
||||
throw new Error(`network ${proxy.network} is unsupported`);
|
||||
}
|
||||
appendIfPresent(`,obfs-uri=${proxy['ws-opts'].path}`, 'ws-opts.path');
|
||||
appendIfPresent(
|
||||
`,obfs-host=${proxy[`${proxy.network}-opts`].headers.Host}`,
|
||||
`${proxy.network}-opts.headers.Host`,
|
||||
);
|
||||
} else {
|
||||
// over-tls
|
||||
if (proxy.tls) append(`,obfs=over-tls`);
|
||||
}
|
||||
|
||||
// tls fingerprint
|
||||
@@ -233,7 +220,11 @@ function vmess(proxy) {
|
||||
appendIfPresent(`,tls-host=${proxy.sni}`, 'sni');
|
||||
|
||||
// AEAD
|
||||
appendIfPresent(`,aead=${proxy.alterId === 0}`, 'alterId');
|
||||
if (isPresent(proxy, 'aead')) {
|
||||
append(`,aead=${proxy.aead}`);
|
||||
} else {
|
||||
append(`,aead=${proxy.alterId === 0}`);
|
||||
}
|
||||
|
||||
// tfo
|
||||
appendIfPresent(`,fast-open=${proxy.tfo}`, 'tfo');
|
||||
|
||||
@@ -6,7 +6,7 @@ export default function Stash_Producer() {
|
||||
proxies
|
||||
.map((proxy) => {
|
||||
delete proxy['tls-fingerprint'];
|
||||
delete proxy['vmess-aead'];
|
||||
delete proxy['aead'];
|
||||
return ' - ' + JSON.stringify(proxy) + '\n';
|
||||
})
|
||||
.join('')
|
||||
|
||||
@@ -124,7 +124,11 @@ function vmess(proxy) {
|
||||
}
|
||||
|
||||
// AEAD
|
||||
result.appendIfPresent(`,vmess-aead=${proxy.alterId === 0}`, 'alterId');
|
||||
if (isPresent(proxy, 'aead')) {
|
||||
result.append(`,vmess-aead=${proxy.aead}`);
|
||||
} else {
|
||||
result.append(`,vmess-aead=${proxy.alterId === 0}`);
|
||||
}
|
||||
|
||||
// tls fingerprint
|
||||
result.appendIfPresent(
|
||||
|
||||
Reference in New Issue
Block a user