| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Transit
Description
Magic Wormhole is a technology for getting things from one computer to another, safely.
To use it, you must use the MagicWormhole library to first establish an encrypted connection:
- Start a
Sessionwith the Rendezvous server, to allow peers to find each other (runClient) - Negotiate a shared
Nameplateso peers can find each other on the server (allocate,list) - Use the shared
Nameplatetoopena sharedMailbox - Use a secret password shared between peers to establish an encrypted connection (
withEncryptedConnection)
Once you've done this, you can communicate with your peer via send and receive.
Once can send and receive either Text messages or Files.
The password is never sent over the wire. Rather, it is used to negotiate a session key using SPAKE2, and that key itself is used to derive many per-message keys, so that each message is encrypted using NaCl SecretBox.
Synopsis
- data Env = Env {}
- prepareAppEnv :: Text -> FilePath -> Options -> IO Env
- app :: App ()
- runApp :: App a -> Env -> IO (Either Error a)
- data Options = Options {
- cmd :: Command
- relayEndpoint :: WebSocketEndpoint
- transitUrl :: RelayEndpoint
- data Command
- = Send MessageType
- | Receive (Maybe Text)
- data Error
- data MessageType
- parseWebSocketEndpoint :: String -> Maybe WebSocketEndpoint
- parseTransitRelayUri :: String -> Maybe RelayEndpoint
Documentation
Magic Wormhole transit app environment
prepareAppEnv :: Text -> FilePath -> Options -> IO Env Source #
A file transfer application that takes an Env and depending on the
config options, either sends or receives a file, directory or a text
message from the peer.
Application Configuration options
Constructors
| Options | |
Fields
| |
Commands
Constructors
| Send MessageType | Send a file, directory or a text message |
| Receive (Maybe Text) | Receive a file, directory or a text message |
An Error type for the Magic Wormhole Transit Module
Instances
| Show Error Source # | |
| Exception Error Source # | |
Defined in Transit.Internal.Errors Methods toException :: Error -> SomeException fromException :: SomeException -> Maybe Error displayException :: Error -> String | |
data MessageType Source #
Transfer type
Instances
| Eq MessageType Source # | |
Defined in Transit.Internal.FileTransfer | |
| Show MessageType Source # | |
Defined in Transit.Internal.FileTransfer Methods showsPrec :: Int -> MessageType -> ShowS show :: MessageType -> String showList :: [MessageType] -> ShowS | |
parseWebSocketEndpoint :: String -> Maybe WebSocketEndpoint #
parseTransitRelayUri :: String -> Maybe RelayEndpoint Source #
Parse transit url of the form tcp:hostname:port