A wire-compatible Rust implementation of Soar, the DNS tunnel for networks that censor everything except DNS. Its client and server interoperate with the Go ones.
The protocol is specified in Soar's SPEC.md,
and described at soar.lantern.io.
This crate is tested against the reference implementation's wire test vectors, in
testdata/vectors.json. They're copied from getlantern/soar at the
commit pinned in testdata/VECTORS_REF, and CI checks that the copy
matches.
Early work. The protocol itself is still pre-release.
- Wire layer: varints, base32, the DNS carrier (TXT and AAAA), frames, the handshake and key schedule, packet protection. Every section of the test vectors passes.
- Session: streams, packet numbers, acknowledgement and loss, flow control. A sans-IO core: no sockets and no clock, so it's deterministic under test and embeddable without Tokio.
- Server: an authoritative name server for the zone, with held polls, signed
unknown-session answers, amplification limits, and public-only dialing.
ServerCoreis the sans-IO protocol;server::serveruns it on Tokio. Thesoar-serverbinary takes the same flags and key files as the Go one. - Client: every resolver as a path with its own RTT, loss and congestion window; name-length
and answer-size probing; AAAA fallback; TCP/53 links; signed unknown-session handling; resolver
discovery with the same bundled lists as the Go client.
ClientCoreis the sans-IO protocol;client::Clientruns it on Tokio, with each stream aConnthat implementsAsyncReadandAsyncWrite. Thesoar-clientbinary forwards local TCP connections through the tunnel. - Interop CI, both ways: the Go client against the Rust server (
interop/run.sh), and the Rust client against the Go server (interop/run-reverse.sh). - A
dnsbenchcontender ingetlantern/soar/bench, so the Rust implementation is benchmarked alongside Soar's Go one and the other DNS tunnels.
cargo install --path . # or: cargo build --release
(umask 077; soar-server keygen | awk '$1 == "private" { print $2 }' > key)
soar-server pubkey key # the public key, for clients
soar-server -zone t.example.com -key-file key -listen :53By default streams may reach only public addresses on ports 80 and 443 (-allow-ports,
-allow-private).
soar-client -zone t.example.com -pubkey BASE64 -resolver 8.8.8.8,1.1.1.1 \
-listen 127.0.0.1:7000 -forward example.com:443Or as a library:
let mut cfg = ClientConfig::new("t.example.com", server_key, &["8.8.8.8", "1.1.1.1"]);
cfg.discovery.enabled = true;
let client = Client::new(cfg).await?;
let mut conn = client.connect("example.com:443").await?; // AsyncRead + AsyncWriteinterop/run.sh builds the Rust server and drives the Go client from getlantern/soar against it:
fetches, uploads, echo, concurrent streams, refused destinations. interop/run-reverse.sh runs
the same checks with the Rust client (examples/interop_client.rs) against the Go server. Both
check programs also run against any server (-server, -pubkey, -v for path stats).
When the wire format changes in getlantern/soar, pull its new vectors and pin the commit:
scripts/sync-vectors.sh main # or a commit sha
cargo testApache 2.0.