mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2026-12-03 09:45:54 +00:00
feat: Surfboard 支持 AnyTLS
This commit is contained in:
4 files changed
+28
-5
No files matched your search
@@ -136,6 +136,7 @@ async function processFn(
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(rawArgs);
|
||||
url = `${url.split('#')[0]}${
|
||||
rawArgs[2]
|
||||
? `#${rawArgs[2]}`
|
||||
|
||||
@@ -26,6 +26,8 @@ export default function Surfboard_Producer() {
|
||||
return http(proxy);
|
||||
case 'socks5':
|
||||
return socks5(proxy);
|
||||
case 'anytls':
|
||||
return anytls(proxy);
|
||||
case 'wireguard-surge':
|
||||
return wireguard(proxy);
|
||||
}
|
||||
@@ -35,7 +37,29 @@ export default function Surfboard_Producer() {
|
||||
};
|
||||
return { produce };
|
||||
}
|
||||
function anytls(proxy) {
|
||||
const result = new Result(proxy);
|
||||
result.append(`${proxy.name}=${proxy.type},${proxy.server},${proxy.port}`);
|
||||
result.appendIfPresent(`,password="${proxy.password}"`, 'password');
|
||||
|
||||
// tls verification
|
||||
result.appendIfPresent(`,sni=${proxy.sni}`, 'sni');
|
||||
result.appendIfPresent(
|
||||
`,skip-cert-verify=${proxy['skip-cert-verify']}`,
|
||||
'skip-cert-verify',
|
||||
);
|
||||
|
||||
// tfo
|
||||
result.appendIfPresent(`,tfo=${proxy.tfo}`, 'tfo');
|
||||
|
||||
// udp
|
||||
result.appendIfPresent(`,udp-relay=${proxy.udp}`, 'udp');
|
||||
|
||||
// reuse
|
||||
result.appendIfPresent(`,reuse=${proxy['reuse']}`, 'reuse');
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
function shadowsocks(proxy) {
|
||||
const result = new Result(proxy);
|
||||
result.append(`${proxy.name}=${proxy.type},${proxy.server},${proxy.port}`);
|
||||
|
||||
Reference in new issue
Block a user