feat: 输入增加 Hysteria2 URI 支持; Surge Hysteria2 输出增加 fingerprint

This commit is contained in:
xream
2023-10-11 23:35:42 +08:00
parent e7c0b23222
commit bf81ca4acf
3 changed files with 56 additions and 1 deletions

View File

@@ -367,6 +367,9 @@ function wireguard(proxy) {
}
function hysteria2(proxy) {
if (proxy.obfs || proxy['obfs-password']) {
throw new Error(`obfs is unsupported`);
}
const result = new Result(proxy);
result.append(`${proxy.name}=hysteria2,${proxy.server},${proxy.port}`);
@@ -388,6 +391,10 @@ function hysteria2(proxy) {
`,skip-cert-verify=${proxy['skip-cert-verify']}`,
'skip-cert-verify',
);
result.appendIfPresent(
`,server-cert-fingerprint-sha256=${proxy.fingerprint}`,
'fingerprint',
);
// tfo
result.appendIfPresent(`,tfo=${proxy['fast-open']}`, 'fast-open');