implementation of peer-to-peer protocol
For use with tor hidden services, and perhaps other transports later. Based on Utility.SimpleProtocol, it's a line-based protocol, interspersed with transfers of bytestrings of a specified size. Implementation of the local and remote sides of the protocol is done using a free monad. This lets monadic code be included here, without tying it to any particular way to get bytes peer-to-peer. This adds a dependency on the haskell package "free", although that was probably pulled in transitively from other dependencies already. This commit was sponsored by Jeff Goeke-Smith on Patreon.
This commit is contained in:
parent
e830285431
commit
65e903397c
8 changed files with 268 additions and 12 deletions
8
Remote/External/Types.hs
vendored
8
Remote/External/Types.hs
vendored
|
@ -250,14 +250,6 @@ instance Proto.Serializable Direction where
|
|||
deserialize "RETRIEVE" = Just Download
|
||||
deserialize _ = Nothing
|
||||
|
||||
instance Proto.Serializable Key where
|
||||
serialize = key2file
|
||||
deserialize = file2key
|
||||
|
||||
instance Proto.Serializable [Char] where
|
||||
serialize = id
|
||||
deserialize = Just
|
||||
|
||||
instance Proto.Serializable ProtocolVersion where
|
||||
serialize = show
|
||||
deserialize = readish
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue