48 Commits
Author SHA1 Message Date
cfal a150125c6b Add conditions syntax for routing rules (#278)
* feat(config): add conditions while preserving mask rules

Accept conditions alongside the existing masks and mask spellings, rejecting conflicting matching fields and flat-source combinations. Normalize all forms into the existing predicate engine.

Add explicit masks leaves for composed expressions and source groups. Keep simple address exports compact and serialize richer rules under conditions.

Cover round-trips, nested source discovery, controller payloads, warning-free compatibility, and routing across accepted and rejected reloads.

* docs(routing): explain conditions and compatible mask syntax

Document expression composition, conflicting fields, source shorthand, and canonical serialization in English and Chinese. Record the controller diagnostic shape in the changelog.

Add a complete conditions example, validate it through the native configuration pipeline, and show conditions in the rule-source example.

* fix(config): clarify invalid rule conditions diagnostics

Name the mutually exclusive matching fields explicitly, including legacy aliases, instead of reporting an unwritten duplicate conditions key.

Explain that nested masks leaves accept only strings or nonempty string lists, with regression tests for JSON/YAML conflicts and invalid leaf shapes.

* refactor(tests): simplify rule conditions coverage

Stage all spelling and format variants before checking their shared canonical form. Restore that form once while preserving per-variant compilation and the complete decision matrix.

Remove conflict inputs already covered by stronger diagnostic assertions, clarify controller payload names, and validate all five rule forms in one fixture per CLI mode.

* fix(rules): correct source-group predicate guidance

Recommend the rule_source_group predicate without a masks wrapper so the rename hint works in nested expressions and source groups. Cover the suggested syntax and diagnostic in regression tests.

Update both documentation locales to describe source-group references under conditions or masks, including boolean composition.
2026-11-06 15:51:49 +08:00
cfal 79cfce6ac0 Add opt-in NTP application clock correction (#270)
Add optional NTP synchronization for hosts where shoes cannot set the system clock. Share the corrected time across REALITY, VMess, Shadowsocks 2022, and TLS certificate validation, using protected direct UDP with bounded synchronization, periodic refresh, and reload-safe ownership. Preserve timestamp windows and replay protection, retain the last correction on refresh failure, and document configuration and clock limitations.
2026-11-03 21:50:41 +08:00
cfal d8481fae2d Add global default DNS configuration (#264)
Add optional global_settings.default_dns so listeners, TUN entries, and WireGuard inbounds can share DNS configuration without repetition. Omitted or null inbound DNS inherits the default, while explicit objects override it completely. Inline fake-IP defaults share one pool, and independent bootstrap and service lookups remain unchanged. Includes validation, regression coverage, and English and Chinese documentation.
2026-11-01 21:49:50 +08:00
cfal ab770fe05c Support whole-path client groups with resolved routing plans (#256)
Allow client groups to select complete paths of different lengths consistently across forwarding, DNS, downloads, and carrier routes. Separate source configuration from bounded runtime plans, preserve selection boundaries and per-flow path pinning, and keep TCP/UDP rotation and automatic selection independent. Unify chain syntax while retaining legacy proxy-list alternatives, and cache up to 16 NaiveProxy sessions by selected prefix, pruning closed entries before LRU eviction without interrupting active tunnels. Add routing measurements, lifecycle coverage, and updated English and Chinese configuration guidance.
2026-11-01 18:49:23 +08:00
cfal ea472a97bc docs: add Simplified Chinese and language selector (#263) 2026-11-01 17:01:17 +08:00
cfal 53282c5019 Add configuration documentation site (#260)
* Validate published configuration examples

* Move configuration reference into Starlight site

* Check documentation site in CI

* Complete optional docs dependency lock entries
2026-11-01 03:15:45 +08:00
cfal 49520657fc Clean up benchmark artifacts and deployment examples (#258)
Removes historical benchmark output while preserving links to archived results, refreshes benchmark documentation, and keeps test scratch files outside the checkout. Moves the manual desktop systemd unit into examples and updates deployment instructions without changing release packaging or mobile integration.
2026-11-01 02:21:45 +08:00
cfal 753d14a436 Add config-driven remote rule sources (#231)
Add reusable rule-source groups and config-driven remote downloads with explicit proxy and DNS routing, in-memory retention, and optional private atomic disk caching. Preserve active traffic across download and reload failures while keeping configuration checks offline. Consolidate process-wide limits and rule_cache_dir under global_settings, retain global_limits as a warning-emitting alias, and remove ordered fallback groups and health_check configuration.
2026-10-31 19:46:04 +08:00
cfal e0282cf72c Add native Hysteria2 and TUIC clients (#249)
Adds native Hysteria2 and TUIC v5 outbound clients so proxy routes can use either protocol directly for TCP and UDP. Includes pooled QUIC connections with bounded resource use, cancellation-safe TUIC commands, Hysteria2 Salamander obfuscation and port hopping, hardened HTTP/3 authentication, TLS verification, configuration examples, and interoperability coverage in CI.
2026-10-31 16:56:16 +08:00
cfal 7460f5d046 Add managed Linux desktop TUN capture (#241)
Add managed Linux TUN and REDIRECT capture with independent DNS interception, protected bootstrap and outbound sockets, best-effort systemd-resolved integration, and retained-ingress reload and recovery. Include configuration documentation, service integration, and kernel coverage.
2026-10-30 15:07:46 +08:00
cfal 8f52f98103 Support SS2022 client identity key chains (#233)
Support server-key:user-key and longer identity chains for Shadowsocks 2022 AES clients, allowing connections to multi-user servers and identity relays. Add the required identity headers, configuration validation, and usage documentation while preserving existing single-key and legacy configurations. This is client-only support; native SS2022 UDP and server-side multi-user support remain out of scope.
2026-10-26 18:39:44 +08:00
cfal f94fa61e36 Make native DNS cache freshness explicit (#227)
Add a system-only native_cache_secs option for configurable OS/NSS application memoization while preserving the existing 60-second implicit default and uncached explicit system behavior. Disable completed-cache reads and writes for zero windows, reject invalid DNS options, and document freshness and lookup-sharing semantics.
2026-10-26 14:56:33 +07:00
cfal b0b30617a2 Add automatic URL-test upstream groups (#221)
Add URL-scoped health and delay-based upstream selection so new connections can use healthy, transport-compatible proxies without requiring a controller listener. This introduces strict client_group.type configuration in place of strategy, bounded automatic probes with lazy activity tracking and reload fencing, controller reporting, and configuration documentation. It also preserves local failure attribution through outbound HTTP/2 adapters so local resource limits do not incorrectly penalize proxy health.
2026-10-24 23:52:28 -04:00
cfal a40aae55cc Improve native DNS caching and coalesce concurrent lookups (#220)
Share native resolver cache entries across destination ports and coalesce concurrent misses with bounded, cancellation-safe ownership. Preserve ordered address candidates, caller ports, and error details while using a conservative 60-second result-age policy rather than a DNS record TTL. Cover cancellation, expiry, failure, and capacity limits with deterministic tests and document the default behavior and trade-offs.
2026-10-24 20:44:33 -04:00
cfal f6abcd8245 Add ACME certificates and live TLS/QUIC rotation (#217)
Add shared file and ACME certificate sources for automatic issuance, renewal, and live TLS/QUIC rotation without interrupting existing connections. Support HTTP-01 and TLS-ALPN-01, durable retry and account state, and CLI/FFI lifecycle handoffs. Extend live rotation to existing file-backed identities and document stricter certificate validation requirements.
2026-10-24 06:17:31 -04:00
cfal fbcc5f9d46 Add Clash API and runtime proxy selectors (#213)
Expose runtime proxy selection and connection visibility without restarting Shoes. This adds an opt-in authenticated Clash-compatible TCP/Unix API, persistent selector choices, traffic and connection statistics, delay probes, live logs, and per-flow cancellation, with reload-aware integration across proxy protocols, DNS, and TUN.
2026-10-23 17:50:36 -04:00
cfal 5fc319a13d Add indexed routing predicates and local rule sources (#201)
Compile routing rules into shared indexes while preserving ordered policy evaluation and DNS decisions. Add typed predicates and bounded local SRS, sing-box JSON, Mihomo YAML/text/MRS, and GeoSite/GeoIP DAT sources through named rule groups or inline masks, with format detection, source caching, pre-activation compilation, and source-aware reloads. Include configuration examples, regression coverage, benchmark tooling, and dependency notices.
2026-10-20 22:11:01 -04:00
cfal 76df520c34 Add route-only HTTP Host sniffing (#198)
Extend opt-in TCP sniffing to use cleartext HTTP/1.0 and HTTP/1.1 Host headers alongside TLS SNI for hostname-based routing. Preserve original destinations, byte replay, sniff limits, Fake DNS precedence, and one route per connection. Add strict parsing, transport and lifecycle coverage, documentation, and an authenticated example with local-address safeguards.
2026-10-20 02:01:12 -04:00
cfal f485914a93 Add opt-in Fake DNS and TLS SNI routing (#195)
Add opt-in Fake DNS and TLS SNI routing for clients that connect by IP. Restore synthetic destinations across TCP, UDP, and TUN while preserving reply identities; prefer sniffed SNI for hostname rules without rewriting connection targets. Add persistent fake-IP mappings, stable WireGuard server identities through optional names or public keys, upstream-address guards, deadline-aware DNS fallback, configuration documentation, and examples.
2026-10-19 10:54:40 -04:00
cfal c17693c001 Unify WireGuard client and server configuration (#191)
Make WireGuard use the same inline client and server protocol syntax as other proxies, replacing named endpoints before release. Add automatic sharing of equivalent clients, encrypted peer chains, explicit server routing policy, and validation that rejects conflicting settings while keeping unused clients inactive. Update examples, configuration documentation, and lifecycle and interoperability coverage.
2026-10-18 15:00:43 -04:00
cfal 2be0409531 Add userspace WireGuard endpoints (#186)
Add named userspace WireGuard endpoints so Shoes can route inbound and outbound traffic through WireGuard without a kernel interface. Includes TCP/UDP forwarding, proxy-chain transports, reload lifecycle management, configuration validation, documentation, and dependency notices for release artifacts.
2026-10-17 15:23:44 -04:00
cfal db35d96276 Add native VLESS Encryption and resumption (#185)
Add opt-in native VLESS Encryption with X25519 and ML-KEM key chains, authenticated record encryption, bounded session resumption, and native Vision support while preserving legacy TLS/REALITY behavior and outer transports. Include validated configuration, credential generation, examples, interoperability fixtures, and regression coverage.
2026-10-17 12:24:08 -04:00
cfal 001495285a Add HTTP/2 CONNECT proxy support (#184)
Add standard HTTP/2 CONNECT to HTTP and mixed listeners and opt-in HTTP proxy clients, allowing concurrent TCP tunnels to share a connection while preserving legacy HTTP/1 and NaiveProxy behavior. Keep the H2 transport independent of NaiveProxy, preserve route isolation and per-stream authentication, require matching TLS ALPN for explicit H2 clients, and handle flow control, cancellation, and graceful shutdown. Include configuration documentation, an example, compatibility regressions, and interoperability coverage for sing-box, Mihomo, and the native Caddy-based Naive server.
2026-10-16 17:54:08 -04:00
cfal 0cc416f8c5 Improve XHTTP backpressure and interoperability (#180)
Improve XHTTP transfer reliability under slow destinations and resource pressure with bounded packet pipelining, admission before body reads, queue-acceptance acknowledgements, and cancellation-safe session handling. Preserve reusable H1 uploads, correct H2/H3 finalization, add configurable receive windows and download-tail timeouts, validate effective request capacity, and expand Xray/Mihomo interoperability coverage with pinned peers in CI.
2026-10-16 07:49:20 -04:00
cfal 5b8da8fd61 Add XHTTP/SplitHTTP transport support (#179)
Adds Xray-compatible XHTTP/SplitHTTP with packet-up, stream-up, and stream-one modes over HTTP/1.1, HTTP/2, and HTTP/3, including REALITY and existing proxy chains. Bounded buffering, flow-control-aware admission, connection pooling, and inactivity-based timeouts maintain backpressure without imposing a minimum upload rate. Preserves TLS key-exchange and ML-DSA policies, adds configuration examples and interoperability coverage, and vendors an h3 fix to prevent empty DATA frames from truncating streams.
2026-10-15 13:39:44 -04:00
cfal 41dd02fd26 examples: add dns examples 2026-04-08 16:56:48 +08:00
cfal c5637d48bb examples/hysteria2.yaml: add ipv6 example 2026-01-21 06:58:23 +04:00
cfal 92408f822f update docs and examples 2026-01-20 02:10:35 +04:00
cfal 4eafedc5ee 0.2.5 update 2026-01-09 01:17:08 +04:00
cfal b2b7121622 0.2.1 update 2025-12-04 06:02:43 +04:00
cfal ced60d27e3 0.2.0 update 2025-11-26 22:59:30 +04:00
cfal 9e16b71f48 switch to named pem (#69)
* examples/named_certificates.yaml: update for named pems

* config: update for named pems

* thread_util.rs: allow re-setting

* CONFIG.md: updated for named pem

* main.rs: update for new validation flow

* Cargo.toml: add tempfile for tests

* inline format args for cargo clippy
2025-07-31 08:57:56 +04:00
cfal cfe5a8bf84 support named certs and keys (#66)
* support named certs and keys

* CONFIG.md: update

* .gitignore: only ignore root yamls

* examples: add more examples
2025-06-23 14:06:59 +04:00
cfal c624c6389e config: better errors, add tests (#65)
* add custom Serialize and Deserialize traits and remove serde untagged structs

* examples/shadowtls_v3_remote_handshake.yaml: fix example

* .github/workflows: add test workflows

* tcp/tcp_handler_util.rs: cargo fmt

* clippy fixes

* cargo fmt
2025-06-22 22:56:39 +04:00
cfal 6311f9dd5f examples: update ShadowTLS examples 2025-03-11 02:02:01 +04:00
cfal f0e1198154 examples/shadowtls_v3_remote_handshake.yaml: update example for user-specified 2025-03-10 04:03:52 +04:00
cfal cd71220a0e examples: add ShadowTLS v3 examples 2025-03-10 01:21:26 +04:00
cfal 708e4e7a3a examples/tuic_v5_port_range.yaml: add port range example 2025-03-06 22:20:27 +04:00
cfal 0b5fb4a872 examples: add TUIC v5 example 2025-03-06 22:20:27 +04:00
cfal 35b23f504a examples/hysteria2.yaml: fix hysteria2 alpn in example 2025-02-24 02:29:42 +09:00
cfal 3bf344233f examples/hysteria2.yaml: add hysteria2 example 2025-02-17 04:15:26 +04:00
cfal f860f448be examples/vless_over_tls.yaml: add vless example 2025-02-17 04:15:26 +04:00
cfal 7f7f66f07e examples/trojan_tls_through_socks.yaml: add example 2024-08-01 02:22:46 +02:00
cfal f65957fe3b examples: add socks through vmess 2023-03-28 00:27:20 +09:00
cfal 60c44a864e examples: add socks server through TLS vmess server example 2023-03-27 16:06:13 +09:00
cfal 7d5364e94e examples: add socks server through vmess example 2023-03-27 13:59:44 +09:00
cfal f5264f3789 Add more examples 2023-02-26 01:29:07 +09:00
cfal 321bc60f7c add some examples 2023-02-20 23:52:21 +09:00