Fix trojan URI issues

This commit is contained in:
Peng-YM
2022-06-20 19:32:57 +08:00
parent da44dc9cab
commit 287082027e
6 changed files with 19 additions and 39 deletions

View File

@@ -144,6 +144,11 @@ function trojan(proxy) {
}
}
// over tls
if (proxy.network !== 'ws' && needTls(proxy)) {
append(`,over-tls=true`);
}
// tls fingerprint
appendIfPresent(
`,tls-cert-sha256=${proxy['tls-fingerprint']}`,
@@ -327,6 +332,7 @@ function needTls(proxy) {
proxy.tls ||
proxy.sni ||
typeof proxy['skip-cert-verify'] !== 'undefined' ||
typeof proxy['tls-fingerprint'] !== 'undefined' ||
typeof proxy['tls-host'] !== 'undefined'
);
}