shadowvpn 0.1.1

A UDP-based, pre-shared-key (PSK), user-mode VPN using the shadowsocks AEAD UDP wire scheme.
Documentation
[package]
name = "shadowvpn"
version = "0.1.1"
edition = "2021"
description = "A UDP-based, pre-shared-key (PSK), user-mode VPN using the shadowsocks AEAD UDP wire scheme."
license = "MIT"
repository = "https://github.com/madeye/shadowvpn"
homepage = "https://github.com/madeye/shadowvpn"
documentation = "https://docs.rs/shadowvpn"
readme = "README.md"
keywords = ["vpn", "tunnel", "shadowsocks", "udp", "aead"]
categories = ["network-programming", "command-line-utilities"]
# Keep the published package lean: ship the crate sources, README, and LICENSE,
# but not the CI / Docker test harness or platform launcher scripts.
exclude = ["/docker", "/.github", "/scripts"]

# docs.rs builds with all features so the optional `uri` module is documented.
[package.metadata.docs.rs]
all-features = true

[lib]
name = "shadowvpn"
path = "src/lib.rs"

[[bin]]
name = "shadowvpn-server"
path = "src/bin/server.rs"

[[bin]]
name = "shadowvpn-client"
path = "src/bin/client.rs"

# Standalone config import/export tool. Built only with `--features uri`, so the
# server/client builds never pull in the QR/image dependencies.
[[bin]]
name = "shadowvpn-uri"
path = "src/bin/uri.rs"
required-features = ["uri"]

[features]
# Off by default: enables the `shadowvpn://` URI / QR tooling (the
# `shadowvpn-uri` binary and the `shadowvpn::uri` module) and its dependencies.
default = []
uri = ["dep:base64", "dep:qrcode", "dep:rqrr", "dep:image"]

[dependencies]
# Async runtime.
tokio = { version = "1.52", features = ["full"] }

# Cross-platform async TUN device (macOS utun + Linux). The `async_tokio`
# feature provides AsyncRead/AsyncWrite + recv/send for the device.
tun-rs = { version = "2.8", features = ["async_tokio"] }

# AEAD ciphers (RustCrypto). 0.11 line shares the `aead` 0.6 traits.
# `alloc` enables the `Aead::encrypt`/`decrypt` Vec<u8> convenience methods.
aead = { version = "0.6", features = ["alloc"] }
aes-gcm = { version = "0.11.0-rc.4", features = ["alloc"] }
chacha20poly1305 = { version = "0.11.0-rc.3", features = ["alloc"] }

# Key derivation: HKDF-SHA1 subkeys + MD5-based EVP_BytesToKey master key.
hkdf = "0.13"
sha1 = "0.11"
md-5 = "0.11"

# Error handling.
anyhow = "1.0"
thiserror = "2.0"

# CLI + config.
clap = { version = "4.6", features = ["derive"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

# Randomness (per-datagram salt).
rand = "0.10"

# Logging.
log = "0.4"
env_logger = "0.11"
maxminddb = "0.28.1"
ipnetwork = "0.21.1"
libc = "0.2.186"

# Config import/export as a `shadowvpn://` URI + QR code. Optional: gated by the
# `uri` feature and only pulled in by the `shadowvpn-uri` tool, so the default
# server/client builds stay lean (no image-decoding code).
base64 = { version = "0.22", optional = true }
qrcode = { version = "0.14", optional = true }
# QR-image decoding for `import --image` (PNG/JPEG only to slim the build).
rqrr = { version = "0.9", optional = true }
image = { version = "0.25", default-features = false, features = [
    "png",
    "jpeg",
], optional = true }

# Windows policy routing: program per-destination routes via the IP Helper API
# (CreateIpForwardEntry2) and resolve the tun interface index — no `route.exe`.
[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.61", features = [
    "Win32_Foundation",
    "Win32_Networking_WinSock",
    "Win32_NetworkManagement_IpHelper",
    "Win32_NetworkManagement_Ndis",
] }