magic_wormhole/lib.rs
1//! In reality, there is no one "Magic Wormhole" protocol. What makes Wormhole work is a handful of different protocols
2//! and handshakes, layered on another and weaved together. This allows other applications to build upon the parts they want
3//! and then add new ones special to their needs.
4//!
5//! At the core, there is a rendezvous server with a message box that allows clients to connect to and perform a PAKE.
6//! Protocol wise, this is split into the "client-server" part (connect to a server, allocate nameplates, send and receive messages)
7//! and a "client-client" part (do a key exchange).
8//!
9//! Two clients that are connected to each other need to know beforehand how to communicate with each other once the connection is established.
10//! This why they have an [`AppID`]. The protocol they use to talk to each other is bound to the AppID. Clients with different AppIDs cannot communicate.
11//!
12//! Magic Wormhole is known for its ability to transfer files. This is implemented in the [`transfer`] module, which builds upon the wormhole
13//! protocol and thus requires a [`Wormhole`].
14//!
15//! As an alternative to file transfer, there is the [`forwarding`] module, which allows to forward arbitrary TCP connections over the Wormhole/Transit tunnel.
16//!
17//! Transferring large amounts of data should not be done over the rendezvous server. Instead, you have to set up a [`transit`]
18//! connection. A transit is little more than an encrypted TcpConnection. If a direct connection between both clients is not possible,
19//! a relay server will transparently connect them together. Transit is used by the file transfer for example, but any other AppID protocol
20//! might make use of it as well.
21
22#![deny(unsafe_code)]
23#![allow(clippy::upper_case_acronyms)]
24#![allow(clippy::too_many_arguments)]
25#![allow(unused_macros)]
26#![warn(missing_docs)]
27
28#[macro_use]
29mod util;
30mod core;
31#[cfg(feature = "forwarding")]
32pub mod forwarding;
33#[cfg(feature = "transfer")]
34pub mod transfer;
35#[cfg(feature = "transit")]
36pub mod transit;
37#[cfg(feature = "transfer")]
38pub mod uri;
39
40#[allow(deprecated)]
41pub use crate::core::{
42 key::{GenericKey, Key, KeyPurpose, WormholeKey},
43 rendezvous, AppConfig, AppID, Code, MailboxConnection, Mood, Nameplate, ParseCodeError,
44 ParseNameplateError, ParsePasswordError, Password, Wormhole, WormholeError, WormholeWelcome,
45};
46
47#[doc(hidden)]
48pub use core::wordlist::Wordlist;