Commit Graph
3338 Commits
Author SHA1 Message Date
renovate[bot] 2685784494 chore(deps): update rust crate log to v0.4.30 2026-05-25 09:52:38 +00:00
renovate[bot] 4b666c134c chore(deps): update rust crate rpassword to v7.5.3 2026-05-22 21:49:55 +00:00
renovate[bot] c6e6480fa2 chore(deps): update rust crate mimalloc to v0.1.52 2026-05-22 15:48:49 +00:00
renovate[bot] 7e712abd6e chore(deps): update rust crate serde_json to v1.0.150 2026-05-21 21:09:47 +00:00
renovate[bot] c506d37d83 chore(deps): update rust crate mimalloc to v0.1.51 2026-05-20 18:26:58 +00:00
renovate[bot] e5257f7e01 fix(deps): update rust crate spin to 0.12 (#2136)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-05-20 18:26:39 +00:00
renovate[bot] 26619f00c1 chore(deps): update rust crate pin-project to v1.1.13 2026-05-13 20:52:02 +00:00
renovate[bot] 343f90ff9b chore(deps): update rust crate tun to v0.8.9 2026-05-13 05:39:16 +00:00
renovate[bot] 0698790844 chore(deps): update rust crate nix to v0.31.3 2026-05-11 11:32:52 +00:00
Andy Ye aa4946260b Document redir iptables setup 2026-05-11 19:31:55 +08:00
renovate[bot] c4d8d18527 chore(deps): update rust crate windows-service to v0.8.1 2026-05-08 17:05:01 +00:00
renovate[bot] 72a922915d chore(deps): update rust crate tokio to v1.52.3 2026-05-08 14:34:54 +00:00
renovate[bot] a78795d193 chore(deps): update rust crate tun to v0.8.8 2026-05-08 06:36:40 +00:00
renovate[bot] 2d5dc4001d chore(deps): update rust crate rpassword to v7.5.2 2026-05-06 15:38:21 +08:00
renovate[bot] 37d8e23361 chore(deps): update rust crate tokio to v1.52.2 2026-05-06 15:38:03 +08:00
dependabot[bot] caf7efac9e chore(deps): bump openssl in the cargo group across 1 directory
Bumps the cargo group with 1 update in the / directory: [openssl](https://github.com/rust-openssl/rust-openssl).


Updates `openssl` from 0.10.75 to 0.10.79
- [Release notes](https://github.com/rust-openssl/rust-openssl/releases)
- [Commits](https://github.com/rust-openssl/rust-openssl/compare/openssl-v0.10.75...openssl-v0.10.79)

---
updated-dependencies:
- dependency-name: openssl
  dependency-version: 0.10.78
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-06 15:37:51 +08:00
ty 9f6ec2597d fix: RUSTSEC-2026-0119 2026-05-06 15:37:15 +08:00
ty b2fc8a7447 fix: RUSTSEC-2026-0119 2026-05-06 14:32:32 +08:00
renovate[bot] 89a19d0035 chore(deps): update rust crate hickory-resolver to v0.26.1 2026-05-06 14:31:29 +08:00
renovate[bot] a7f21a4326 chore(deps): update rust crate pin-project to v1.1.12 2026-05-06 14:30:41 +08:00
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