feat: 支持 Loon Hysteria2 salamander 混淆

This commit is contained in:
xream
2024-06-16 21:49:13 +08:00
parent ad3d2270ac
commit 11d9ce7372
4 changed files with 11 additions and 5 deletions

View File

@@ -408,8 +408,8 @@ function wireguard(proxy) {
}
function hysteria2(proxy) {
if (proxy.obfs || proxy['obfs-password']) {
throw new Error(`obfs is unsupported`);
if (proxy['obfs-password'] && proxy.obfs != 'salamander') {
throw new Error(`only salamander obfs is supported`);
}
const result = new Result(proxy);
result.append(`${proxy.name}=Hysteria2,${proxy.server},${proxy.port}`);
@@ -423,6 +423,10 @@ function hysteria2(proxy) {
'skip-cert-verify',
);
if (proxy['obfs-password'] && proxy.obfs == 'salamander') {
result.append(`,salamander-password="${proxy['obfs-password']}"`);
}
// tfo
result.appendIfPresent(`,fast-open=${proxy.tfo}`, 'tfo');