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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//! # tunnet
//!
//! Embed a Tunnet mesh node inside any Rust application — Tailscale's tsnet for Rust.
//!
//! ```no_run
//! use tunnet::TunnetNode;
//! use tokio::io::{AsyncReadExt, AsyncWriteExt};
//!
//! #[tokio::main]
//! async fn main() -> tunnet::Result<()> {
//! let node = TunnetNode::builder()
//! .hostname("my-service")
//! .state_dir("/var/lib/my-app/tunnet")
//! .api_key("tnnt_key_...")
//! .organization_id("org_...")
//! .network_id("00000000-0000-0000-0000-000000000000")
//! .control_url("https://cp.tunnet.io")
//! .management_url("https://api.tunnet.io")
//! .standalone(true)
//! .start()
//! .await?;
//!
//! let mut stream = node.open_stream("10.0.0.5", 8080).await?;
//! stream.write_all(b"hello").await?;
//! let mut buf = [0u8; 64];
//! let n = stream.read(&mut buf).await?;
//! println!("got {} bytes", n);
//! Ok(())
//! }
//! ```
//!
//! ## Features
//!
//! - `managed` (default) — control-plane enrollment and sync
//! - `direct` — re-exports for Direct / local-first mode types
//! - `send` — file transfer APIs
//! - `serve` — mesh reverse-proxy (`serve`) APIs
pub use enroll;
pub use ;
pub use ;
pub use StreamListener;
pub use ;
pub use Peer;
pub use TunnetStream;
pub use policy;
pub use ;
pub use ServeInfo;
pub use Transfer;
pub use ServeAcl;
/// Direct / local-first mode helpers and types.