shadowsocks-rust / rules
Cursor rule11k starsChanged 8 months agoMITView on GitHub
shadowsocks-rust workspace orientation (binaries, crates, features, hot paths)
Trending
More talk lately.about the whole repository
Who's talking about shadowsocks/shadowsocks-rust
- Neddie Shadowsocks“Windows Shadowsocks Server”YouTube · Oct 16, 2021 · 9.3k views
- rust-lang/rust“Implement network primitives with ideal Rust layout, not C system layout”GitHub · Nov 6, 2020 · 139 reactions
- net4people/bbs“Sharing a modified Shadowsocks as well as our thoughts on the cat-and-mouse game”GitHub · Oct 15, 2022 · 34 reactions
- NixOS/nixpkgs“Module request: shadowsocks-rust service”GitHub · Jan 28, 2024 · 16 reactions
- iamwwcposts/articles“记录 Tun 透明代理的多种实现方式,以及如何避免 routing loop”GitHub · Aug 1, 2021 · 8 reactions
The biggest 5 of 64 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 64
Talked about on GitHub, Bluesky, YouTube and Hacker News (64 times).
On GitHub · 50
- Nov 6, 2020Implement network primitives with ideal Rust layout, not C system layout — rust-lang/rust139 reactions · 127 comments
- Oct 15, 2022Sharing a modified Shadowsocks as well as our thoughts on the cat-and-mouse game — net4people/bbs34 reactions · 68 comments
- Jan 28, 2024Module request: shadowsocks-rust service — NixOS/nixpkgs16 reactions
- Aug 1, 2021记录 Tun 透明代理的多种实现方式,以及如何避免 routing loop — iamwwcposts/articles8 reactions · 8 comments
- Apr 24, 2021Properly configured Shadowsocks servers reportedly blocked in China? — net4people/bbs6 reactions · 51 comments
45 more on GitHub
- Aug 27, 2020Brook 服务端实现缺陷可能导致主动探测 — txthinking/brook6 reactions · 6 comments
- May 18, 2018Compiler crashed with cannot create local mono-item — rust-lang/rust6 reactions · 31 comments
- Jan 17, 2024Wishlist for new benchmarks — dtcxzyw/llvm-opt-benchmarksays it tested it5 reactions · 15 comments
- Sep 11, 2022[Security] Do not engineer vulnerabilities into implementations without public discussions — shadowsocks/shadowsocks-org4 reactions · 7 comments
- Aug 8, 2020Build on Github Action with macos-latest missing dependencies — rust-lang/cargo4 reactions · 10 comments
- Jun 12, 2023need support Shadowsocks 2022 Edition — getsurfboard/surfboard3 reactions
- Mar 10, 2024Support SSManager API — qdm12/ss-server2 reactions
- Dec 11, 2023Add support for "optimize tcp buffers" option per profile. — shadowsocks/shadowsocks-android2 reactions · 9 comments
- Mar 29, 2022bpf.rs build failed for aarch64-apple-ios target — smoltcp-rs/smoltcp2 reactions · 2 comments
- Apr 25, 2021Add shadowsocks-rust — archlinuxcn/repo2 reactions
- Dec 23, 2024[Bug] 连启用tfo的ss协议的节点,v1.18.10、v1.19.0和alpha-89dfabe内核会导致ssl连接出错 — MetaCubeX/mihomo1 reaction · 3 comments
- May 25, 2024x86_64-pc-windows-gnu build failed — aws/aws-lc-rs1 reaction · 11 comments
- Apr 24, 2023fix(macOS): sc_unit should be the number in name + 1 — meh/rust-tun1 reaction
- Feb 2, 2023作为插件配合 shadowsocks-rust 使用时监听端口不正确的问题 — shadowsocks/qtun1 reaction · 4 comments
- Dec 14, 2020gost 的 Shadowsocks 服务端实现缺陷可能导致主动探测 — ginuerzh/gost1 reaction · 4 comments
- Oct 9, 2026Add Unix Domain Socket listener support — v2fly/v2ray-core0 reactions
- Sep 29, 2026deps(rust)(deps): bump the rust-dependencies group across 1 directory with 41 updates — cjkjfs/bwbrowser0 reactions · 1 comment
- Sep 26, 2026deps(rust)(deps): bump the rust-dependencies group across 1 directory with 34 updates — cjkjfs/bwbrowser0 reactions · 2 comments
- Sep 26, 2026deps(rust)(deps): bump the rust-dependencies group in /src-tauri with 11 updates — donutbrowser/donutbrowser0 reactions
- Sep 21, 2026deps(rust)(deps): bump the rust-dependencies group in /src-tauri with 22 updates — cjkjfs/bwbrowser0 reactions · 1 comment
- Sep 19, 2026deps(rust)(deps): bump the rust-dependencies group in /src-tauri with 60 updates — donutbrowser/donutbrowser0 reactions
- Sep 16, 2026deps(rust)(deps): Bump the rust-dependencies group in /src-tauri with 52 updates — anuschatgptgo-star/tube-academy-browser0 reactions · 1 comment
- Sep 13, 2026shadowsocks2022: fix TCP data loss under backpressure — merrkry/kotoconn0 reactions · 1 comment
- Sep 5, 2026chore(deps): bump the rust-dependencies group across 1 directory with 17 updates — gaojunv/rust-tunnel0 reactions
- Sep 4, 2026chore(deps): update dependency shadowsocks/shadowsocks-rust to v1.25.0 — bindreams/postern0 reactions · 1 comment
- Sep 3, 2026deps(rust)(deps): bump the rust-dependencies group in /src-tauri with 24 updates — baodev15/MMOBrowser0 reactions · 1 comment
- Aug 31, 2026deps: bump the rust-minor-and-patch group across 1 directory with 31 updates — MiChongs/WutherCore0 reactions · 1 comment
- Aug 26, 2026shadowsocks-rust: 1.24.0 -> 1.25.0 — NixOS/nixpkgs0 reactions
- Aug 26, 2026pkgs: 2026-Aug-26 — MidAutumnMoon/TaysiTsuki0 reactions
- Aug 26, 2026shadowsocks-rust 1.25.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Aug 3, 2026[WIP] Fix incorrect listening port issue with Shadowsocks-Rust plugin — shadowsocks/qtun0 reactions
- Jul 10, 2026Allow setting fwmark — aisk/rust-ping0 reactions · 2 comments
- May 5, 2026Add SIP003U UDP relay support — shadowsocks/v2ray-plugin0 reactions · 1 comment
- May 5, 2026Migrate test workspace `rustls` crypto provider to `aws-lc-rs` (and enforce `X25519MLKEM768`) — mullvad/mullvadvpn-app0 reactions
- Dec 16, 2025feat(shadowsocks_rust): add package — brioche-dev/brioche-packages0 reactions · 1 comment
- Dec 11, 2025shadowsocks-rust 1.24.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Dec 11, 2025shadowsocks-rust: 1.23.5 -> 1.24.0 — NixOS/nixpkgs0 reactions
- Dec 11, 2025pkgs: 2025-Dec-11 — MidAutumnMoon/TaysiTsuki0 reactions
- Dec 3, 2025Fix NetBSD build error due to UData type mismatched — tokio-rs/mio0 reactions
- Sep 28, 2025Shadowsocks update web UI ciphers to match shadowsocks rust — opnsense/plugins0 reactions · 20 comments
- Jul 13, 2025build(deps): bump the rust-dependencies group with 7 updates — ibigbug/clash-rs0 reactions · 10 comments
- Jul 4, 2025shadowsocks-rust: 1.23.4 -> 1.23.5 — NixOS/nixpkgs0 reactions · 1 comment
- Jul 4, 2025shadowsocks-rust 1.23.5 — Homebrew/homebrew-core0 reactions · 1 comment
- Jul 4, 2025pkgs: update 2025/Jul/04 — MidAutumnMoon/TaysiTsuki0 reactions
- May 22, 2025shadowsocks-rust: 1.23.3 -> 1.23.4 — NixOS/nixpkgs0 reactions
On Bluesky · 12
- Nov 6, 2023Bonjour et bon lundi ! Si vous cherchez un proxy/tunnel, voici shadowsocks-rust, un portage de shadowsocks et réécrit en Rust. Evicemment,… — @ponceto91.bsky.social6 likes and reposts
- Jan 13, 2025shadowsocks / shadowsocks-rust: A Rust port of shadowsocks ★8924 https://github.com/shadowsocks/shadowsocks-rust — @rusttrending.bsky.social3 likes and reposts
- Dec 24, 2024shadowsocks / shadowsocks-rust: A Rust port of shadowsocks ★8831 https://github.com/shadowsocks/shadowsocks-rust — @rusttrending.bsky.social3 likes and reposts
- Mar 14, 2025shadowsocks / shadowsocks-rust: A Rust port of shadowsocks ★9118 https://github.com/shadowsocks/shadowsocks-rust — @rusttrending.bsky.social2 likes and reposts
- Nov 16, 2024shadowsocks / shadowsocks-rust: A Rust port of shadowsocks ★8656 https://github.com/shadowsocks/shadowsocks-rust — @rusttrending.bsky.social2 likes and reposts
7 more on Bluesky
- Nov 6, 2024shadowsocks / shadowsocks-rust: A Rust port of shadowsocks ★8622 https://github.com/shadowsocks/shadowsocks-rust — @rusttrending.bsky.social2 likes and reposts
- Jan 22, 2026shadowsocks / shadowsocks-rust: A Rust port of shadowsocks ★10235 https://github.com/shadowsocks/shadowsocks-rust — @rusttrending.bsky.social1 likes and repost
- Oct 27, 2025shadowsocks / shadowsocks-rust: A Rust port of shadowsocks ★9933 https://github.com/shadowsocks/shadowsocks-rust — @rusttrending.bsky.social1 likes and repost
- Jun 16, 2025shadowsocks / shadowsocks-rust: A Rust port of shadowsocks ★9513 https://github.com/shadowsocks/shadowsocks-rust — @rusttrending.bsky.social1 likes and repost
- Feb 7, 2025shadowsocks / shadowsocks-rust: A Rust port of shadowsocks ★9003 https://github.com/shadowsocks/shadowsocks-rust — @rusttrending.bsky.social1 likes and repost
- Oct 18, 2024shadowsocks / shadowsocks-rust: A Rust port of shadowsocks ★8529 https://github.com/shadowsocks/shadowsocks-rust — @rusttrending.bsky.social1 likes and repost
- Jun 10, 2024shadowsocks / shadowsocks-rust: A Rust port of shadowsocks ★7971 https://github.com/shadowsocks/shadowsocks-rust — @rusttrending.bsky.social1 likes and repost
On YouTube · 1
- Oct 16, 2021Windows Shadowsocks Server — Neddie Shadowsocks9.3k views · 10 comments
On Hacker News · 1
- Sep 20, 2019A Rust Port of Shadowsocks2 points
The file
Files
---
description: shadowsocks-rust workspace orientation (binaries, crates, features, hot paths)
alwaysApply: true
---
# shadowsocks-rust orientation
## Toolchain
- **Edition**: 2024. **MSRV**: `1.91` (root + both crates; `clippy.toml` matches). Breaking bumps are semver-major for this repo.
- **Workspace**: root `shadowsocks-rust` + `crates/shadowsocks` + `crates/shadowsocks-service` (see root `Cargo.toml` `[workspace]`).
## Dependency direction
```
shadowsocks-rust (binaries, CLI, logging, allocators)
└── shadowsocks-service (roles, config load, ACL, DNS helpers, local modes)
└── shadowsocks (protocol, relay I/O, crypto facade)
└── shadowsocks-crypto (ciphers; optional ring / AEAD-2022, etc.)
```
- **Do not** make `shadowsocks` depend on `shadowsocks-service`. New shared logic belongs in `shadowsocks` or a small shared module, not the reverse.
## Root crate (`shadowsocks-rust`)
- **`bin/*.rs`**: thin `main` — build `clap` `Command`, delegate to `shadowsocks_rust::service::{local,server,manager,...}` (`src/service/*.rs`).
- **`src/lib.rs`**: `VERSION`, re-exports service entrypoints.
- **`src/config.rs`**, **`src/logging/*`**, **`src/daemonize/*`**, **`src/monitor/*`**, **`src/allocator/*`**: process-wide concerns (not protocol).
- **Features**: root features mostly **forward** to `shadowsocks-service/...` (e.g. `local` → `shadowsocks-service/local`, `local-tun` → `local-tun` + `ipnet`). Prefer enabling capability on the service crate when adding optional deps.
## `crates/shadowsocks` (core)
- **Role**: `ServerConfig`, relay primitives, SOCKS5 `Address`, manager wire protocol, `Context`, sockets (`net`), plugins.
- **High-signal paths**:
- **TCP / stream tunneling**: `relay/tcprelay/` (`ProxyListener`, `ProxyClientStream`, proxy stream protocol under `proxy_stream/`).
- **UDP**: `relay/udprelay/` (`ProxySocket`), **`net/udp.rs`** (socket wrapper, `batch_send` / `batch_recv`), **`net/sys/unix/*`** (Linux batching via `sendmmsg`/`recvmmsg`-style APIs).
- **Manager**: `manager/`.
- **DNS resolver hook**: `dns_resolver/`.
## `crates/shadowsocks-service`
- **Role**: runnable **local** (`sslocal`), **server** (`ssserver`), **manager** (`ssmanager`); loads JSON5 config; ACL; Hickory DNS integration; platform redir/tun/http.
- **Layout** (under `src/`):
- **`local/`** — SOCKS4/5 (`local/socks/`), HTTP proxy (`local/http/`), transparent **redir** (`local/redir/`, per-OS `sys/` subdirs), **tunnel**, **TUN** (`local/tun/` — `smoltcp` user stack when `local-tun`), **fake-dns**, **online_config** (SIP008), **dns** relay, **net/tcp|udp** listeners, **loadbalancing** (`PingBalancer`), **`context.rs`** (`ServiceContext`).
- **`server/`** — TCP/UDP relay servers (`tcprelay.rs`, `udprelay.rs`), `server.rs`, `context.rs`.
- **`manager/`** — manager daemon.
- **`acl/`** — ACL matching.
- **`dns/`**, **`net/`** — shared service-layer DNS / flow / sockets.
- **`config.rs`** — service config types and loading.
- **`local/context.rs`**: central handle for accept opts, balancer, ACL, DNS — most local features thread through here.
## Main binaries (feature-gated)
| Binary | Feature | Typical entry |
|---------------|-------------|----------------|
| `sslocal` | `local` | `src/service/local.rs` → `shadowsocks_service::run_local` |
| `ssserver` | `server` | `src/service/server.rs` |
| `ssmanager` | `manager` | `src/service/manager.rs` |
| `ssurl` | `utility` | own bin + optional `utility-url-outline` / `reqwest` |
| `ssservice` | `service` | wrapper for packaged multi-role |
| `sswinservice`| `winservice`| Windows service |
## Where to look (common tasks)
- **Local UDP association / performance**: `crates/shadowsocks-service/src/local/net/udp/association.rs` + core `crates/shadowsocks/src/net/udp.rs` + `crates/shadowsocks/src/net/sys/unix/*`.
- **TCP local accept / upstream**: `local/net/tcp/`, `relay/tcprelay/` (core).
- **TLS to local HTTP / DNS-over-TLS**: `shadowsocks-service` optional `tokio-rustls`, `rustls-native-certs`, Hickory features (`dns-over-tls`, etc.).
- **TUN / smoltcp**: `local/tun/*.rs` (device bridge, TCP manager thread, IP parsing); dep `smoltcp` with `medium-ip`, TCP/UDP sockets.
## Design notes
- **Async**: Tokio throughout service layer; core relay types are often used from async contexts.
- **Config**: JSON5 files + CLI; many structs under `shadowsocks`/`shadowsocks-service` `config` modules — search `Config` / `ServerConfig` before duplicating options.
- **Tests**: workspace integration tests in `tests/*.rs`; `crates/shadowsocks/tests/`; `#[cfg(test)]` modules beside sources.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

