Commit Graph
3318 Commits
Author SHA1 Message Date
renovate[bot]andzonyitoo d817982cd1 fix(deps): update rust crate hickory-resolver to 0.26 (#2114)
* fix(deps): update rust crate hickory-resolver to 0.26

* fix: compat hickory-resolver 0.26

* fix: remove unused import

* fix: removed unnecessary deref

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: zonyitoo <zonyitoo@gmail.com>
2026-05-05 17:14:39 +08:00
Linus Färnstrand 9fca88bc93 Replace ring with aws-lc-rs across the dependency tree
Switches the cryptographic backend so that ring is no longer pulled
into shadowsocks-rust on any supported target.

* shadowsocks-crypto: use the new aws-lc-rs backend in place of
  the ring feature
* tokio-rustls: select the aws_lc_rs provider instead of ring.
* hickory-resolver: use tls-aws-lc-rs, https-aws-lc-rs and
  h3-aws-lc-rs in place of the *-ring variants.

The only remaining ring path in the dependency tree is via quinn-proto on
wasm32-unknown-unknown, which aws-lc-rs cannot target and which
shadowsocks does not support.
2026-05-05 17:13:29 +08:00
renovate[bot]andzonyitoo 75d44c7956 fix(deps): update rust crate aes to 0.9 (#2107)
* fix(deps): update rust crate aes to 0.9

* feat: compat cipher 0.5

* fix: replaced deprecated from_slice

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: zonyitoo <zonyitoo@gmail.com>
2026-05-01 22:41:59 +08:00
ty fc8cd59981 feat(service): outbound UDP relay through SOCKS5-only chains
Phase 2 of the outbound proxy refactor. The new
OutboundProxyDatagram type implements DatagramSocket / DatagramSend /
DatagramReceive on top of a freshly-bound local UDP socket plus one
SOCKS5 UDP ASSOCIATE per chain hop. Each datagram on the wire carries
N nested UdpAssociateHeader frames (one per hop), the inner-most one
addressing the ss-server's UDP external endpoint.

Per-hop control connections are built by reusing the existing TCP
chain builder (connect_chain_for_udp_associate) so all of the
shadowsocks DNS resolver / ConnectOpts behaviour still applies.

Integration:

* OutboundProxyClient::associate_udp + supports_udp().
* OutboundProxyClient::supports_udp() returns true iff every hop is
  SOCKS5; HTTP/HTTPS hops cannot transport UDP and downgrade the
  whole chain to 'unsupported'.
* local::net::udp::association::create_proxied_socket dispatches
  based on supports_udp(): when true the per-association socket is
  ProxySocket<OutboundProxyDatagram> wrapping the chained datagram;
  otherwise we keep the previous direct ProxySocket<ShadowUdpSocket>.
* When the chain is configured but unable to relay UDP, sslocal /
  ssserver emit a single startup WARN ('UDP traffic will bypass the
  chain') instead of failing — runtime traffic transparently falls
  back to a direct connection to the ss-server.

OutboundProxyStream gains try_into_tcp() so SOCKS5-only chains can
recover the bare TcpStream as keep-alive control connections —
Sync-friendly storage required because the HTTP CONNECT variant
internally holds a hyper::upgrade::Upgraded which is !Sync.
2026-05-01 22:23:51 +08:00
ty 250ae60446 refactor(service)!: rework outbound proxy chain into a unified client
Replace the previous parallel outbound proxy implementations
(net::outbound_proxy + local::net::tcp::outbound_proxy) with a single
self-contained module at net::outbound, exposing OutboundProxyClient,
OutboundProxyStream, Socks5Auth, HttpProxyAuth and a TcpDialer trait.

Highlights:

* OutboundProxyStream is now a closed-set enum (Bypassed / Https / Http)
  with statically-dispatched poll_* — no more Box<dyn ProxyStream>. The
  HTTPS variant boxes its inner OutboundProxyStream solely to break the
  recursive type instantiation required by the TLS libraries; this is
  not dynamic dispatch.
* HTTP CONNECT client is rebuilt on top of hyper::client::conn::http1
  + hyper::upgrade. The hand-rolled status-line parser (which could
  drop bytes that arrived in the same read() as the header terminator,
  did not handle 100-Continue, etc.) is gone.
* Auth parameters are now strongly typed:
    Socks5Auth::{None, UsernamePassword{..}}
    HttpProxyAuth::{None, Basic{..}}
  Both enums are #[non_exhaustive] for forward compatibility.
* AutoProxyClientStream's ProxiedViaChain variant is folded back into a
  single Proxied(ProxyClientStream<MonProxyStream<OutboundTransport>>)
  variant, with OutboundTransport = Direct(TcpStream) | Chained(...).
* ServiceContext (both server and local) now caches an
  Arc<OutboundProxyClient> built once at set_outbound_proxies time
  instead of re-parsing the chain on every connection.
* The standalone Socks5TcpClient / Socks5UdpClient implementations
  previously duplicated across net::socks5_client and
  local::socks::client::socks5 are unified into the latter location;
  net::outbound::socks5 only keeps the chain-friendly Socks5Negotiator.
* When UDP is enabled but the configured chain contains a non-SOCKS5
  hop, sslocal/ssserver emits a single startup warning. Phase 2 will
  add UDP relay support for SOCKS5-only chains.

BREAKING CHANGE: the following items have moved or been removed:

* crate::net::outbound_proxy — removed; use crate::net::OutboundProxyClient
* crate::net::http_connect::HttpConnectClient — moved to
  crate::net::HttpConnectClient (only available with the local-http feature)
* crate::net::Socks5TcpClient (the chain-mixing wrapper) — split: the
  pure SOCKS5 client is now crate::local::socks::client::socks5::Socks5TcpClient;
  the in-band negotiator is crate::net::Socks5Negotiator
* crate::local::net::tcp::outbound_proxy — removed
* ServiceContext::outbound_proxies() — replaced by outbound_client()
  returning Option<&Arc<OutboundProxyClient>>
2026-05-01 22:23:51 +08:00
renovate[bot] e2ecfaeee3 chore(deps): update rust crate smoltcp to v0.13.1 2026-04-30 23:51:11 +00:00
renovate[bot] ebf12fbc3a chore(deps): update rust crate rpassword to v7.5.1 (#2126)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-29 19:48:45 +08:00
renovate[bot] 240271027f chore(deps): update rust crate reqwest to v0.13.3 2026-04-27 14:30:57 +00:00
renovate[bot] 80dab1a04e chore(deps): update rust crate mimalloc to v0.1.50 2026-04-26 13:12:10 +08:00
renovate[bot] e3511a55d5 chore(deps): update rust crate libc to v0.2.186 (#2122)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-26 00:33:40 +00:00
renovate[bot] 99e9cfd16f chore(deps): update rust crate blake3 to v1.8.5 (#2123)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-25 22:54:15 +00:00
Alessandro Riva bb039a6ac0 feat: add eih support 2026-04-26 01:24:30 +08:00
zonyitoo 554cfb9fbe fix: rustls-webpki upgraded to v0.103.13, RUSTSEC-2026-0104 2026-04-26 01:18:34 +08:00
renovate[bot] 3d5c09512c fix(deps): update rust crate etherparse to 0.20 2026-04-20 08:40:57 +00:00
renovate[bot] fa8013844d chore(deps): update rust docker tag to v1.95.0 (#2118)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-20 08:40:30 +00:00
renovate[bot] 7152147994 chore(deps): update rust crate tokio to v1.52.1 (#2110)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-20 05:16:56 +00:00
renovate[bot] 357056ea74 chore(deps): update rust crate mimalloc to v0.1.49 2026-04-20 01:26:30 +00:00
renovate[bot] 632f6da0dc chore(deps): update rust crate webpki-roots to v1.0.7 (#2116)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-20 01:26:07 +00:00
renovate[bot] 78bf620cd3 chore(deps): update rust crate tracing-appender to v0.2.5 (#2119)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-19 21:05:41 +00:00
renovate[bot] 3b3c659283 chore(deps): update rust crate clap to v4.6.1 (#2113)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-19 17:32:28 +00:00
Linus Färnstrand d37fd371d1 Remove unused imports in outbound_proxy (#2111)
* Remove unused imports in outbound_proxy

* Upgrade rustls-webpki to a version without advisories

* Upgrade rand to a version without advisories
2026-04-19 22:34:55 +08:00
ty f8b9f63a44 chore: update rustls-webpki, RUSTSEC-2026-0099 2026-04-19 22:32:13 +08:00
renovate[bot] cd4edcc646 chore(deps): update rust crate tun to v0.8.7 2026-04-14 09:44:55 +00:00
renovate[bot] d718a7337b chore(deps): update rust crate libc to v0.2.185 2026-04-13 13:53:28 +00:00
renovate[bot] 597dfeb8af chore(deps): update softprops/action-gh-release action to v3 (#2108)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-12 22:15:47 +08:00
Yuwei BaandCopilot a71d8a0f40 feat: expose user_key() on CryptoStream and ProxyServerStream (#2109)
After an AEAD2022 handshake with a ServerUserManager, the authenticated
user's raw key is available inside DecryptedReader but not reachable
from the public API.  Expose it via:

  CryptoStream::user_key()       -> Option<&[u8]>
  ProxyServerStream::user_key()  -> Option<&[u8]>

This lets callers (e.g. clash-rs) identify which multi-user identity
was authenticated without having to manually peek and re-derive the
identity subkey via BLAKE3 + AES-256-ECB before the handshake.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-12 22:15:25 +08:00
zonyitoo 6df217c09a feat(proxy-client): refactor outbound_proxy to use concrete proxy clients
- Extract HttpConnectClient to dedicated http_connect.rs module
- Add conduct_handshake_and_connect method to Socks5TcpClient for stream-based SOCKS5 negotiation
- Refactor outbound_proxy to use Socks5TcpClient and HttpConnectClient methods instead of direct protocol implementation
- Update module exports in net/mod.rs
2026-04-12 22:14:49 +08:00
zonyitoo 948cd5ad9f refactor: extract HttpConnectClient to dedicated http_connect module
- Move HttpConnectClient from socks5_client.rs to standalone http_connect.rs
- HttpConnectClient encapsulates HTTP CONNECT protocol implementation
- socks5_client.rs focuses exclusively on SOCKS5 protocol handling
- Update imports in outbound_proxy.rs to use new http_connect module
- Add http_connect module export in net/mod.rs
- All feature combinations compile successfully
2026-04-12 22:13:37 +08:00
renovate[bot] 1a3c3290ae chore(deps): update rust crate rand to v0.10.1 2026-04-11 17:37:55 +00:00
zonyitoo 4d7b9e1203 feat(proxy-chain): refactor outbound proxy architecture
- Move HTTP CONNECT logic to shared outbound_proxy helper module
- Simplify Socks5TcpClient to only handle SOCKS5 protocol, remove OutboundProxyAuth dependency
- Extract proxy chain utilities into separate net/outbound_proxy.rs with HTTP/HTTPS support
- Add UDP mode warnings in local and server startup when proxy chain is configured
- Share ProxyStream trait between modules for better code organization
- Gate HTTPS proxy support with feature flags (local-http-native-tls or local-http-rustls)
2026-04-12 01:12:21 +08:00
zonyitoo c18abd4062 fix: make native-tls optional 2026-04-11 22:48:23 +08:00
Fan Yang 743d0b3931 [Feature]: Allow to chain ssserver to another socks5/http/https proxy #1397 (#2106)
* Add outbound SOCKS5 proxy chains with auth

* Add HTTP and HTTPS CONNECT support to outbound proxy chains

* Initialize outbound proxy chains in manager server configs

* Fix outbound proxy chain handling and share HTTPS transport

* docs: update README for outbound proxy chains
2026-04-11 22:10:08 +08:00
renovate[bot] 904e3ed43b chore(deps): update rust crate tokio to v1.51.1 (#2105)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-09 23:46:02 +08:00
renovate[bot] 263f00fb73 chore(deps): update rust crate arc-swap to v1.9.1 2026-04-04 08:33:51 +00:00
renovate[bot] 4c8634d036 chore(deps): update rust crate libc to v0.2.184 (#2104)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-03 17:57:03 +00:00
renovate[bot] 69c1022760 chore(deps): update rust crate tokio to v1.51.0 2026-04-03 09:51:09 +00:00
renovate[bot] 31b2304960 chore(deps): update rust crate hyper to v1.9.0 2026-03-31 20:56:33 +00:00
renovate[bot] c2b3efe615 chore(deps): update rust crate blake3 to v1.8.4 2026-03-30 21:59:04 +00:00
Pain 6c3c1010f1 fix: native build error on arm64 (#2100) 2026-03-27 14:46:43 +08:00
renovate[bot] 7b759e1577 chore(deps): update rust docker tag to v1.94.1 2026-03-27 01:35:35 +00:00
renovate[bot] 92328c2957 fix(deps): update rust crate snmalloc-rs to 0.7 2026-03-25 05:52:32 +00:00
renovate[bot] 68c58621db chore(deps): update rust crate env_logger to v0.11.10 2026-03-23 22:14:21 +00:00
zonyitoo 7d28db736b feat: bump version v1.25.0
- MSRV upgraded to v1.91, due to smoltcp v0.13.
- Upgrade dependencies
- Add cursor rule orientation
2026-03-23 00:03:27 +08:00
renovate[bot]andzonyitoo 2d755f05d6 fix(deps): update rust crate smoltcp to 0.13 (#2094)
* fix(deps): update rust crate smoltcp to 0.13

* chore: raise MSRV to 1.91 for smoltcp 0.13

smoltcp 0.13 requires Rust 1.91. Align rust-version, clippy msrv,
and GitHub MSRV workflow with that toolchain.

Made-with: Cursor

* fix(deps): bump aws-lc-rs for RUSTSEC-2026-0048

Update aws-lc-sys to 0.39.0 via aws-lc-rs 1.16.2 (CRL IDP validation fix).

Made-with: Cursor

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: zonyitoo <zonyitoo@gmail.com>
2026-03-22 23:55:12 +08:00
dependabot[bot] afa9fc3510 chore(deps): bump rustls-webpki from 0.103.8 to 0.103.10 in the cargo group across 1 directory (#2095)
Bumps the cargo group with 1 update in the / directory: [rustls-webpki](https://github.com/rustls/webpki).


Updates `rustls-webpki` from 0.103.8 to 0.103.10
- [Release notes](https://github.com/rustls/webpki/releases)
- [Commits](https://github.com/rustls/webpki/compare/v/0.103.8...v/0.103.10)

---
updated-dependencies:
- dependency-name: rustls-webpki
  dependency-version: 0.103.10
  dependency-type: indirect
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-22 22:33:41 +08:00
renovate[bot] e47b0e5a40 chore(deps): update rust crate arc-swap to v1.9.0 (#2096)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-22 22:33:31 +08:00
Pain 54a27d379f fix: unify alpine base version (#2097) 2026-03-22 22:33:20 +08:00
Aaron Chen ae80b84e22 fix: remove unnecessary double checks in PingBalancer (#2093) 2026-03-19 19:07:24 +08:00
renovate[bot] bb2913f6b5 chore(deps): update docker/metadata-action action to v6 (#2083)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-17 16:30:05 +08:00
renovate[bot] d5317b2735 chore(deps): update docker/setup-buildx-action action to v4 (#2084)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-17 16:29:59 +08:00