Files
yiguodev f870ffe454 Expand Vole client protocols, routing, DNS and HTTP processing (#8)
Add provider generations, automatic proxy groups, richer routing rules and live Controller configuration.
Extend encrypted DNS, persistent fake-IP mappings and GeoData support.
Add HTTP CONNECT, WireGuard, TrustTunnel, Mieru and MASQUE outbounds; expand TLS/ECH and transport compatibility.
Add separately configured H1/H2 MITM and URL, header and body rewriting.
Improve UDP association reuse, TCP delivery and H2/H3 scheduling while keeping memory bounded.
Add Linux TUN route and system DNS management, MPTCP and TCP Brutal.
Replace vendored dependencies with upstream libraries, update and pin Boring 5.4.0, and fix cross-platform builds and CI feature checks.
2026-11-03 08:22:46 +08:00

272 lines
11 KiB
TOML

[workspace]
members = ["crates/vole-blake3-raw", "crates/vole-netstack"]
resolver = "3"
[package]
name = "vole"
version = "0.1.0"
edition = "2024"
license = "MIT"
publish = false
[lib]
name = "vole"
crate-type = ["rlib", "staticlib", "cdylib"]
[[bin]]
name = "vole"
path = "src/bin/vole.rs"
required-features = ["cli"]
[[bin]]
name = "vole-windows-vpn-host"
path = "src/bin/windows_vpn_host.rs"
required-features = ["ffi", "windows-uwp"]
[[bin]]
name = "vole-windows-session-host"
path = "src/bin/windows_session_host.rs"
required-features = ["ffi", "windows-uwp"]
[features]
default = [
"dns-quic",
"inbound-http",
"inbound-socks5",
"outbound-http",
"outbound-anytls",
"outbound-socks5",
"outbound-shadowsocks",
"outbound-trojan",
"outbound-trusttunnel",
"outbound-mieru",
"outbound-masque",
"outbound-vmess",
"outbound-vless",
"outbound-hysteria2",
"outbound-tuic",
"outbound-wireguard",
"shadow-tls-v3",
"sing-mux",
]
inbound-http = ["dep:rcgen", "rcgen/x509-parser", "dep:rsa", "dep:tokio-tungstenite", "dep:hyper", "dep:hyper-util", "dep:x509-parser"]
inbound-socks5 = ["dep:rcgen", "dep:rsa", "dep:ring", "dep:tokio-tungstenite"]
outbound-anytls = ["dep:md-5", "stream-security", "ech"]
outbound-socks5 = []
outbound-http = []
outbound-shadowsocks = ["dep:shadowsocks", "dep:blake3", "stream-security", "stream-transport", "ech", "dep:aes", "dep:ring"]
outbound-vless = ["ech", "stream-security", "boring/mlkem", "dep:blake3", "dep:vole-blake3-raw", "stream-transport", "quinn-h3-transport", "dep:hyper", "dep:hyper-util"]
outbound-trojan = ["stream-transport", "stream-security", "ech"]
outbound-trusttunnel = ["stream-transport", "tls-fingerprint", "ech", "quiche-h3-transport"]
outbound-mieru = ["dep:boring", "dep:chacha20poly1305", "dep:hostname", "dep:prost", "dep:ring"]
outbound-masque = ["stream-transport", "quiche-h3-transport", "dep:vole-netstack"]
outbound-vmess = ["stream-transport", "stream-security", "ech", "dep:aes", "dep:md-5", "dep:ring", "dep:shake"]
stream-security = ["tls-fingerprint", "boring/reality", "boring/jls"]
tls-fingerprint = ["dep:boring", "dep:tokio-boring"]
ech = []
shadow-tls-v3 = ["tls-fingerprint", "boring/shadow-tls-v3", "dep:ring"]
outbound-hysteria2 = ["ech", "quic-transport", "dep:h3", "dep:h3-quinn", "dep:blake2", "dep:hyper", "dep:hyper-util"]
outbound-tuic = ["quic-transport"]
sing-mux = ["stream-transport", "dep:yamux", "tokio-util/compat"]
outbound-wireguard = ["dep:boringtun", "dep:vole-netstack"]
stream-transport = ["dep:tokio-tungstenite", "dep:httparse"]
quic-transport = ["dep:quinn", "dep:quinn-proto"]
# Exposes h3::ConnectionState for connection error/closing checks before reuse.
# h3-quinn does not enable this feature on Vole's behalf.
quinn-h3-transport = ["quic-transport", "dep:h3", "dep:h3-quinn", "h3/i-implement-a-third-party-backend-and-opt-into-breaking-changes"]
quiche-h3-transport = ["quic-transport", "dep:quiche", "dep:boring"]
dns-quic = ["quinn-h3-transport"]
# Enables local interoperability-only trust-root injection. Release build
# scripts must not enable this feature.
interop-test = ["outbound-anytls", "outbound-vless"]
invoke = ["tun", "dns-quic", "tokio/rt-multi-thread", "tokio/signal"]
ffi = ["invoke"]
cli = ["invoke"]
windows-wintun = ["tun", "dep:tun-rs", "dep:windows"]
windows-uwp = ["invoke", "dep:windows", "dep:windows-collections", "dep:windows-core"]
tun = [
"inbound-http",
"inbound-socks5",
"outbound-anytls",
"outbound-http",
"outbound-socks5",
"outbound-shadowsocks",
"outbound-trojan",
"outbound-trusttunnel",
"outbound-mieru",
"outbound-masque",
"outbound-vmess",
"outbound-vless",
"outbound-hysteria2",
"outbound-tuic",
"outbound-wireguard",
"shadow-tls-v3",
"sing-mux",
]
[dependencies]
age = { version = "=0.11.5", default-features = false, features = ["armor"] }
age-core = "=0.11.0"
aes = { version = "0.9.4", optional = true, features = ["zeroize"] }
arc-swap = "1"
async-trait = "0.1"
base64 = "0.23"
bech32 = "=0.12.0"
blake2 = { version = "=0.11.0", optional = true }
blake3 = { version = "=1.8.7", optional = true }
boringtun = { version = "=0.7.1", default-features = false, optional = true }
boring = { git = "https://github.com/YuanDevTeam/boring", rev = "c717137e6c794a0b069f64686a375858ffc80818", version = "=5.4.0", features = ["client-fingerprint"], optional = true }
bytes = "1"
chacha20poly1305 = { version = "=0.11.0", default-features = false, features = ["zeroize"], optional = true }
crc32fast = "=1.5.4"
domain = { version = "=0.12.3", default-features = false, features = ["std"] }
fancy-regex = { version = "=0.20.0", default-features = false, features = ["std", "unicode"] }
flate2 = { version = "=1.1.10", default-features = false, features = ["rust_backend"] }
brotli = { version = "=9.1.1", default-features = false, features = ["std"] }
futures-util = { version = "0.3", features = ["sink"] }
getifaddrs = "=0.6.2"
h2 = "0.4.20"
h3 = { version = "=0.0.8", default-features = false, optional = true }
h3-quinn = { version = "=0.0.10", default-features = false, optional = true }
hpke = { version = "=0.15.1", default-features = false, features = ["alloc", "aes", "chacha", "x25519", "nistp", "mlkem", "shake"] }
hostname = { version = "=0.4.2", default-features = false, optional = true }
http = "1"
hyper = { version = "=1.12.0", default-features = false, features = ["client", "http1"], optional = true }
hyper-util = { version = "=0.1.21", default-features = false, features = ["tokio"], optional = true }
httparse = { version = "1.10", optional = true }
httlib-hpack = "=0.1.3"
idna = "1.1"
libc = "0.2"
md-5 = { version = "0.11", optional = true }
maxminddb = { version = "=0.32.0", default-features = false }
quinn = { version = "=0.11.12", default-features = false, features = ["runtime-tokio", "rustls-ring"], optional = true }
quinn-proto = { version = "=0.11.19", default-features = false, features = ["rustls-ring"], optional = true }
quiche = { version = "=0.30.0", default-features = false, features = ["boringssl-boring-crate"], optional = true }
rand = "0.10"
rcgen = { version = "=0.14.10", default-features = false, features = ["crypto", "ring"], optional = true }
rsa = { version = "=0.9.10", default-features = false, features = ["std"], optional = true }
ring = { version = "0.17.14", optional = true }
redb = "=4.4.0"
psl = "=2.1.246"
prost = { version = "=0.14.4", default-features = false, features = ["derive", "std"], optional = true }
regex = "1.13"
regex-syntax = { version = "0.8", default-features = false, features = ["std", "unicode-case"] }
rustls = { version = "=0.23.46", default-features = false, features = ["ring", "std", "tls12"] }
rustls-native-certs = "=0.8.5"
serde = { version = "1", features = ["derive", "rc"] }
serde_json = { version = "1", features = ["raw_value"] }
serde_yaml_ng = "0.10"
yaml-rust2 = { version = "=0.13.0", default-features = false }
sevenz-rust2 = { version = "=0.24.2", default-features = false }
sha2 = "0.11"
shake = { version = "0.1.0", optional = true }
shadowsocks = { version = "=1.25.0", optional = true, default-features = false, features = ["aead-cipher-2022"] }
socket2 = { version = "0.6", features = ["all"] }
thiserror = "2"
time = { version = "=0.3.55", features = ["formatting"] }
tokio = { version = "1", features = ["io-util", "macros", "net", "rt", "sync", "time"] }
tokio-boring = { git = "https://github.com/YuanDevTeam/boring", rev = "c717137e6c794a0b069f64686a375858ffc80818", version = "=5.4.0", optional = true }
tokio-rustls = { version = "=0.26.6", default-features = false, features = ["ring", "tls12"] }
tokio-tungstenite = { version = "=0.30.0", default-features = false, features = ["handshake"], optional = true }
tokio-util = { version = "0.7", features = ["rt"] }
tracing = "0.1"
tracing-core = "0.1.36"
url = "2"
uuid = { version = "=1.29.0", features = ["serde", "v5"] }
vole-netstack = { path = "crates/vole-netstack", optional = true }
vole-blake3-raw = { path = "crates/vole-blake3-raw", optional = true }
webpki-roots = "1"
x509-parser = { version = "=0.18.1", default-features = false, optional = true }
yamux = { version = "=0.14.1", optional = true }
zeroize = { version = "=1.9.1" }
zstd = { version = "0.14.3", default-features = false }
[target.'cfg(any(target_os = "ios", target_os = "tvos", target_os = "macos"))'.dependencies]
oslog = { version = "0.2", default-features = false }
[target.'cfg(target_os = "linux")'.dependencies]
# Public socket adapter; shared Dialer retains protection, deadlines and Stop.
tokio-tfo = "=0.4.3"
# Core-owned Linux TUN setup uses tun-rs's opt-in address management API.
tun-rs = { version = "=2.8.16", default-features = false, features = ["address-management"] }
[target.'cfg(unix)'.dependencies]
# Keep one Cargo dependency name across target tables. Unix compiles this small
# adapter dependency; platform I/O remains gated by the tun feature.
tun-rs = { version = "=2.8.16", default-features = false }
[target.'cfg(windows)'.dependencies]
tun-rs = { version = "=2.8.16", default-features = false, optional = true, features = ["interruptible"] }
windows = { version = "=0.62.2", optional = true, features = [
"ApplicationModel_Background",
"ApplicationModel_Core",
"Foundation",
"Foundation_Collections",
"Networking",
"Networking_Connectivity",
"Networking_Sockets",
"Networking_Vpn",
"Storage",
"Storage_Search",
"Storage_Streams",
"UI_Core",
"Win32_Foundation",
"Win32_NetworkManagement_IpHelper",
"Win32_NetworkManagement_Ndis",
"Win32_Networking_WinSock",
"Win32_Security",
"Win32_Security_Cryptography",
"Win32_Security_Isolation",
"Win32_System_Com",
"Win32_System_JobObjects",
"Win32_System_RemoteDesktop",
"Win32_System_Threading",
"Win32_System_WinRT",
"Win32_UI_Shell",
] }
# Keep the companion types required by the latest windows SDK. The separately
# released 0.100.x crates are not type-compatible with windows 0.62.2.
windows-collections = { version = "=0.3.2", optional = true }
windows-core = { version = "=0.62.2", optional = true }
[dev-dependencies]
h3 = { version = "=0.0.8", default-features = false }
h3-quinn = { version = "=0.0.10", default-features = false }
sevenz-rust2 = { version = "=0.24.2", default-features = false, features = ["compress"] }
# Native peer controls for bounded in-memory ALPS tests; same source as boring.
boring-sys = { git = "https://github.com/YuanDevTeam/boring", rev = "c717137e6c794a0b069f64686a375858ffc80818", version = "=5.4.0" }
foreign-types = "=0.5.0"
tokio = { version = "1", features = ["test-util"] }
# Independent EIH relay fixture only; production crypto remains the official SS crate.
aes = "0.9"
blake3 = "1"
rcgen = { version = "=0.14.10", default-features = false, features = ["crypto", "ring"] }
tempfile = "3"
[profile.release]
codegen-units = 1
lto = "thin"
opt-level = 3
panic = "unwind"
strip = "symbols"
# Optimized offline tests keep release semantics without linking every test
# executable with production LTO. Platform delivery still uses `release`.
[profile.ci-release]
inherits = "release"
codegen-units = 16
lto = "off"
[lints.rust]
unsafe_code = "allow"
unsafe_op_in_unsafe_fn = "deny"
[lints.clippy]
all = "warn"
pedantic = "allow"
[patch.crates-io]
# quiche and Vole share the same approved Boring commit.
boring = { git = "https://github.com/YuanDevTeam/boring", rev = "c717137e6c794a0b069f64686a375858ffc80818" }
boring-sys = { git = "https://github.com/YuanDevTeam/boring", rev = "c717137e6c794a0b069f64686a375858ffc80818" }