1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright 2026 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
//! # smoldvpn
//!
//! A pure-Rust, userspace 1-/2-hop WireGuard dVPN datapath built on
//! [`boringtun`](https://docs.rs/boringtun) and [`nym_smol_core`], with **no OS
//! `tun` device and no root**. Application traffic flows through the tunnel via
//! ordinary tokio socket surfaces ([`TcpStream`], [`UdpSocket`], and the
//! `tonic`/`hyper`/`reqwest` connectors in [`connectors`]).
//!
//! The datapath is decoupled from provisioning: build a [`PeerConfig`] per hop
//! (e.g. from a `nym-sdk-session` registration) and hand it to a
//! [`TunnelBuilder`]. Three data-plane modes are supported: one-hop, two-hop,
//! and QUIC-tunnelling two-hop (see [`BridgeParams`]).
//!
//! ```no_run
//! # async fn example(entry: nym_smoldvpn::PeerConfig, exit: nym_smoldvpn::PeerConfig)
//! # -> Result<(), Box<dyn std::error::Error>> {
//! use nym_smoldvpn::TunnelBuilder;
//!
//! let tunnel = TunnelBuilder::two_hop(entry, exit).connect().await?;
//! let mut tcp = tunnel.tcp_connect("1.1.1.1:443".parse()?).await?;
//! // ... use `tcp` as any AsyncRead + AsyncWrite ...
//! tunnel.shutdown().await;
//! # Ok(())
//! # }
//! ```
pub use ;
pub use ;
pub use TunnelConnector;
pub use ;
pub use ;
pub use SocketProtector;
pub use ;
/// tokio socket types produced by the tunnel (re-exported from `smol-core`).
pub use ;