diff options
Diffstat (limited to 'P2P/IO.hs')
-rw-r--r-- | P2P/IO.hs | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -10,6 +10,7 @@ module P2P.IO ( RunProto , P2PConnection(..) + , stdioP2PConnection , connectPeer , closeConnection , serveUnixSocket @@ -50,6 +51,15 @@ data P2PConnection = P2PConnection , connOhdl :: Handle } +-- P2PConnection using stdio. +stdioP2PConnection :: Git.Repo -> P2PConnection +stdioP2PConnection g = P2PConnection + { connRepo = g + , connCheckAuth = const False + , connIhdl = stdin + , connOhdl = stdout + } + -- Opens a connection to a peer. Does not authenticate with it. connectPeer :: Git.Repo -> P2PAddress -> IO P2PConnection connectPeer g (TorAnnex onionaddress onionport) = do |