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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
//! # Voynich
//!
//! A library for creating anonymous, encrypted, authenticated chat applications.
//!
//! ## Example code
//!
//! ```no_run
//! use anyhow::Result;
//! use voynich::{
//! connect_to_tor,
//! create_onion_service,
//! Engine,
//! onion_service::OnionType,
//! logger::StandardLogger
//! };
//! use std::str::FromStr;
//! use std::net::SocketAddr;
//! use tor_client_lib::control_connection::{OnionServiceListener, TorSocketAddr};
//!
//! // My UI Application
//! struct App {}
//!
//! impl App {
//! // Run the UI app
//! pub async fn run(
//! engine: &mut Engine,
//! listener: &OnionServiceListener,
//! logger: &mut StandardLogger,
//! ) -> Result<()> {
//! // Run your app
//! Ok(())
//! }
//! }
//!
//! #[tokio::main]
//! async fn main() -> Result<()> {
//! // Get a connection to Tor
//! let mut control_connection = connect_to_tor(
//! SocketAddr::from_str("127.0.0.1:9051").unwrap(),
//! None,
//! None,
//! None,
//! )
//! .await?;
//!
//! // Create our onion service
//! let (mut onion_service, onion_service_address, mut listener) = create_onion_service(
//! &mut control_connection,
//! OnionType::Transient,
//! Some(3000),
//! Some(TorSocketAddr::from_str("127.0.0.1:3000").unwrap()),
//! )
//! .await?;
//!
//! // Set up the engine
//! let mut engine = Engine::new(
//! &mut onion_service,
//! onion_service_address,
//! SocketAddr::from_str("127.0.0.1:9050").unwrap(),
//! false,
//! )
//! .await?;
//!
//! // Logging
//! let mut logger = StandardLogger::new(500);
//!
//! // Pass the engine, listener and logger to your application
//! App::run(&mut engine, &listener, &mut logger).await
//! }
//! ```
/// Chat message structs
/// Configuration files
/// Connection to peer
/// Connection to Tor server
/// Cryptographic functions
/// Engine
/// Logging
/// Onion service struct
/// Utility functions
pub use get_config;
pub use ;
pub use Engine;
pub use test_onion_service_connection;