Skip to content

Commit 7eeaff4

Browse files
committed
feat: Surfboard 支持 AnyTLS
1 parent bf3832a commit 7eeaff4

File tree

4 files changed

+28
-5
lines changed

4 files changed

+28
-5
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,8 @@ Core functionalities:
4343
> [NaiveProxy](https://t.me/zhetengsha/4308)
4444
- [x] QX (SS, SSR, VMess, Trojan, HTTP, SOCKS5, VLESS)
4545
- [x] Loon (SS, SSR, VMess, Trojan, HTTP, SOCKS5, SOCKS5-TLS, WireGuard, VLESS, Hysteria 2)
46-
- [x] Surge (Direct, SS, VMess, Trojan, HTTP, SOCKS5, SOCKS5-TLS, TUIC, Snell, Hysteria 2, SSH(Password authentication only), External Proxy Program(only for macOS), WireGuard(Surge to Surge))
47-
- [x] Surfboard (SS, VMess, Trojan, HTTP, SOCKS5, SOCKS5-TLS, WireGuard(Surfboard to Surfboard))
48-
- [x] Clash.Meta (Direct, SS, SSR, VMess, Trojan, HTTP, SOCKS5, Snell, VLESS, WireGuard, Hysteria, Hysteria 2, TUIC, SSH, mieru, sudoku, AnyTLS)
49-
- [x] Stash (SS, SSR, VMess, Trojan, HTTP, SOCKS5, Snell, VLESS, WireGuard, Hysteria, TUIC, Juicity, SSH)
46+
- [x] Surge (Direct, SS, VMess, Trojan, HTTP, SOCKS5, SOCKS5-TLS, AnyTLS, TrustTunnel, TUIC, Snell, Hysteria 2, SSH(Password authentication only), External Proxy Program(only for macOS), WireGuard(Surge to Surge))
47+
- [x] mihomo(Clash.Meta) Compatible (Direct, SS, SSR, VMess, Trojan, HTTP, SOCKS5, Snell, VLESS, WireGuard, Hysteria, Hysteria 2, TUIC, SSH, mieru, sudoku, AnyTLS, MASQUE)
5048

5149
Deprecated(The frontend doesn't show it, but the backend still supports it, with the query parameter `target=Clash`):
5250

backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sub-store",
3-
"version": "2.21.21",
3+
"version": "2.21.22",
44
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
55
"main": "src/main.js",
66
"scripts": {

backend/src/core/proxy-utils/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ async function processFn(
136136
}
137137
}
138138
}
139+
console.log(rawArgs);
139140
url = `${url.split('#')[0]}${
140141
rawArgs[2]
141142
? `#${rawArgs[2]}`

backend/src/core/proxy-utils/producers/surfboard.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ export default function Surfboard_Producer() {
2626
return http(proxy);
2727
case 'socks5':
2828
return socks5(proxy);
29+
case 'anytls':
30+
return anytls(proxy);
2931
case 'wireguard-surge':
3032
return wireguard(proxy);
3133
}
@@ -35,7 +37,29 @@ export default function Surfboard_Producer() {
3537
};
3638
return { produce };
3739
}
40+
function anytls(proxy) {
41+
const result = new Result(proxy);
42+
result.append(`${proxy.name}=${proxy.type},${proxy.server},${proxy.port}`);
43+
result.appendIfPresent(`,password="${proxy.password}"`, 'password');
44+
45+
// tls verification
46+
result.appendIfPresent(`,sni=${proxy.sni}`, 'sni');
47+
result.appendIfPresent(
48+
`,skip-cert-verify=${proxy['skip-cert-verify']}`,
49+
'skip-cert-verify',
50+
);
3851

52+
// tfo
53+
result.appendIfPresent(`,tfo=${proxy.tfo}`, 'tfo');
54+
55+
// udp
56+
result.appendIfPresent(`,udp-relay=${proxy.udp}`, 'udp');
57+
58+
// reuse
59+
result.appendIfPresent(`,reuse=${proxy['reuse']}`, 'reuse');
60+
61+
return result.toString();
62+
}
3963
function shadowsocks(proxy) {
4064
const result = new Result(proxy);
4165
result.append(`${proxy.name}=${proxy.type},${proxy.server},${proxy.port}`);

0 commit comments

Comments
 (0)