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
//! Native Rust port of [tcpduplex](https://github.com/hdmain/tcpduplex):
//! encrypted full-duplex messaging over TCP (X25519 ECDH, AES-256-GCM).
//!
//! Protocol-compatible with the Go library so `Go ↔ Rust` sessions interoperate.
//!
//! # Quick start
//!
//! ```no_run
//! use rutcpduplex::{dial, serve_conn};
//! use std::net::TcpListener;
//! use std::thread;
//!
//! let ln = TcpListener::bind("127.0.0.1:0").unwrap();
//! let addr = ln.local_addr().unwrap();
//! thread::spawn(move || {
//! let (stream, _) = ln.accept().unwrap();
//! let srv = serve_conn(stream).unwrap();
//! let msg = srv.receive().unwrap();
//! srv.send(&msg).unwrap();
//! let _ = srv.close();
//! });
//!
//! let cli = dial(&addr.to_string()).unwrap();
//! cli.send(b"hello").unwrap();
//! let out = cli.receive().unwrap();
//! assert_eq!(out, b"hello");
//! let _ = cli.close();
//! ```
pub use ;
pub use Conn;
pub use ;
pub use ;
pub use peer_public_key_fingerprint;
pub use Server;
/// Library version string.
pub const VERSION: &str = env!;