feat(anytls): support anytls protocol#7
Merged
Merged
Conversation
Resolves "proxies.[].type unsupported" error when converting mihomo subscriptions that contain `type: anytls` nodes to sing-box. Changes: - clash::proxy: new AnyTls struct + Proxy::Anytls variant (mihomo fields: sni/alpn/skip-cert-verify/idle-session-*/min-idle-session/client-fingerprint) - ProxyParams::AnyTls variant carries tls + idle-session knobs through the cross-protocol IR without falling back to Generic - source.rs: extract AnyTLS for both Clash YAML and sing-box outbound - singbox/clash template processors: emit anytls nodes with bidirectional field normalization (kebab-case <-> snake_case, integer seconds <-> "30s" duration strings) - singbox AnyTLS outbound: min_idle_session is now Option<u32> per official docs (default 0) - subscription.rs: parse anytls:// URI scheme per anytls-go spec (default port 443, IPv6 brackets, optional /? separator) - detect.rs: recognise anytls:// / vless:// / hysteria2:// / hy2:// in subscription/plain-text detection Tests: 4 new cases in tests/parser_test.rs covering Clash extraction, sing-box extraction, Clash->sing-box JSON emission, and anytls:// URL parsing. All 124 existing tests still pass.
Clash trojan proxies without an `alpn:` key (common in real mihomo subscriptions) were rejecting the entire proxies array with "missing field `alpn`". Add #[serde(default)] so absence yields an empty Vec instead. Discovered while validating the AnyTLS conversion against a real mihomo subscription that mixes anytls and trojan nodes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.