Module magic_wormhole::transit
source · Expand description
Connect two sides via TCP, no matter where they are
This protocol is the second part where the Wormhole magic happens. It does not strictly require a Wormhole connection, but it depends on some kind of secure communication channel to talk to the other side. Conveniently, Wormhole provides exactly such a thing :)
Both clients exchange messages containing hints on how to find each other. These may be local IP addresses for in case they are in the same network, or the URL to a relay server. In case a direct connection fails, both will connect to the relay server which will transparently glue the connections together.
Each side might implement (or use/enable) some abilities.
Notice: while the resulting TCP connection is naturally bi-directional, the handshake is not symmetric. There must be one “leader” side and one “follower” side (formerly called “sender” and “receiver”).
Structs
- Defines a way to find the other side.
- hostname and port for direct connection
- Information about how to find a peer
- Hint describing a relay server
- An established Transit connection.
- A partially set up
Transit
connection.
Enums
Constants
- ULR to a default hosted relay server. Please don’t abuse or DOS.
Functions
- Initialize a relay handshake
- Utility method that logs information of the transit result