Skip to content

feat(anytls): support anytls protocol#7

Merged
bitxwave merged 2 commits into
mainfrom
feat/anytls-protocol
Jun 4, 2026
Merged

feat(anytls): support anytls protocol#7
bitxwave merged 2 commits into
mainfrom
feat/anytls-protocol

Conversation

@bitxwave
Copy link
Copy Markdown
Owner

@bitxwave bitxwave commented Jun 4, 2026

No description provided.

bitxwave added 2 commits June 4, 2026 23:59
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.
@bitxwave bitxwave merged commit 44c14d1 into main Jun 4, 2026
15 checks passed
@bitxwave bitxwave deleted the feat/anytls-protocol branch June 5, 2026 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant